Skripta koju koristim:DF v2.4.3
Detaljan opis problema: kucam/agl u igri i nista ne radi komanda, a na kraju mi je skripte
Dio skripte:
//-----------------------------AGL-------------------------------------------------------------------
CMD:agl(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] >= 2)
{
new string[128],giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],ministring[16];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params,"us[16]",giveplayerid,ministring))
{
SCM(playerid, COLOR_WHITE, "Koriscenje: /agl [name] [playerID/DeoImena]");
SCM(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, Police.");
return 1;
}
if(!strfind(ministring,"flying"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Flying License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has given you a Flying License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Flying License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, " That player doesn't has a passport!");
return 1;
}
}
}
else if(!strfind(ministring,"sailing"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Sailing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Sailing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"police"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Police License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Police License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCopLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Police License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"driving"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Driving License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Driving License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Driving License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, "This player hasn't a passport!");
return 1;
}
}
}
else if(!strfind(ministring,"fishing"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Fishing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Fishing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Fishing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"weapon"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Weapon License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Weapon License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, " You are not authorised to use this command!");
return 1;
}
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno): /
Ovo radi 100% samo nije zcmd moraces medju ostale obicne komande!
//-----------------------------AGL-------------------------------------------------------------------
if(strcmp(cmd, "/agl", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
new x_nr[24];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl [name] [playerid/Dio Imena]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, Police.");
return 1;
}
if(strcmp(x_nr,"flying",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl Flying [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Letenje %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s ti je dao Dozvolu za Letenje.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Letenje %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac nema putovnicu!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline!");
return 1;
}
}
else if(strcmp(x_nr,"sailing",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl sailinglicense [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Dozvolu za Plovidbu %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s ti je dao Dozvolu za Plovidbu.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Plovidbu %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline!");
return 1;
}
}
else if(strcmp(x_nr,"police",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl police [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Policajca %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s ti je dao Dozvolu za Policajca.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCopLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Policajca %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline!");
return 1;
}
}
else if(strcmp(x_nr,"driving",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl Driverslicense [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Voznju %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s ti je dao Dozvolu za Voznju.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Voznju %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "This player hasn't a passport!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline !");
return 1;
}
}
else if(strcmp(x_nr,"fishing",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl fishinglicense [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Ribolov %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s ti je dao Dozvolu za Ribolov.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Ribolov %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline!");
return 1;
}
}
else if(strcmp(x_nr,"weapon",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /agl weaponlicense [playerid/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Dao si Dozvolu za Oruzje %s (%d).",giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s ti je dao Dozvolu za Oruzje.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s je dao Dozvolu za Oruzje %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi u mogucnosti koristiti ovu komandu!");
return 1;
}
}
return 1;
}
ali gdje tacno da stavim ?
Stavio sam je Al mi izbacuje 26 erora,sta da radim?
Citat: |LG|Yui_Sang poslato Maj 07, 2013, 18:36:41 POSLE PODNE
Onplayercommandtext
ne ako koristi i zcmd onda pod ovaj OnPlayerCommandPerformed
edit: negdje fali zagrada, prebroj
Ovo sam stavio pod OnPlayerCommandPerformed nije mi izbacio ni jedan eror, al opet nista, ne radi komanda
//-----------------------------AGL-------------------------------------------------------------------
CMD:agl(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] >= 2)
{
new string[128],giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],ministring[16];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params,"us[16]",giveplayerid,ministring))
{
SCM(playerid, COLOR_WHITE, "Koriscenje: /agl [name] [playerID/DeoImena]");
SCM(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, Police.");
return 1;
}
if(!strfind(ministring,"flying"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Flying License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has given you a Flying License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Flying License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, " That player doesn't has a passport!");
return 1;
}
}
}
else if(!strfind(ministring,"sailing"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Sailing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Sailing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"police"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Police License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Police License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCopLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Police License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"driving"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Driving License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Driving License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Driving License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, "This player hasn't a passport!");
return 1;
}
}
}
else if(!strfind(ministring,"fishing"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Fishing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Fishing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Fishing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(!strfind(ministring,"weapon"))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Weapon License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Weapon License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, " You are not authorised to use this command!");
return 1;
}
}
return 1;
}
CMD:agl(playerid, params[])
Ovo izbrisi
if(strcmp(cmd, "/agl", true) == 0)
Stavi ovo
1338,mada meni je 1340 i radi sto?
Nista brate nece, evo gledaj sta mi izbacuje
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41689) : warning 217: loose indentation
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41689) : error 017: undefined symbol "cmd"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41695) : error 017: undefined symbol "idx"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41703) : error 017: undefined symbol "tmp"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41703) : error 017: undefined symbol "idx"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41704) : error 017: undefined symbol "tmp"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41709) : error 017: undefined symbol "giveplayerid"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41709) : error 017: undefined symbol "tmp"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41710) : error 017: undefined symbol "giveplayerid"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41712) : error 017: undefined symbol "giveplayerid"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41714) : error 017: undefined symbol "sendername"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41714) : error 017: undefined symbol "sendername"
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41714) : error 029: invalid expression, assumed zero
A:\NIKOLA\san andreas\SERVER I FORUM\Rapid RolePlay v1.1\gamemodes\Rapid.pwn(41714) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
13 Errors.
//-----------------------------AGL-------------------------------------------------------------------
CMD:agl(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] >= 2)
{
new string[128],giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],ministring[16];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params,"us[16]",giveplayerid,ministring))
{
SCM(playerid, COLOR_WHITE, "Koriscenje: /agl [name] [playerID/DeoImena]");
SCM(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, Police.");
return 1;
}
if(strfind(ministring,"flying",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Flying License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has given you a Flying License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Flying License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, " That player doesn't has a passport!");
return 1;
}
}
}
else if(strfind(ministring,"sailing",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Sailing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Sailing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(strfind(ministring,"police",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Police License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Police License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCopLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Police License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(strfind(ministring,"driving",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pPassport] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Driving License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Driving License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Driving License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_GREY, "This player hasn't a passport!");
return 1;
}
}
}
else if(strfind(ministring,"fishing",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Fishing License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Fishing License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Fishing License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
else if(strfind(ministring,"weapon",true) != -1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've given a Weapon License to %s (%d).",giveplayer, giveplayerid);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
SCM(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Given a Weapon License to %s (%d).",sendername ,giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Given a Weapon License To %s.",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, " You are not authorised to use this command!");
return 1;
}
}
return 1;
}
Probaj tako pa mi javi sta ti vrati da li posalje ista (da li posaljes Unknown command ili se nista ne desi)
@Ostali
Nemojte samo vaditi iz drugih modova komande
nista se ne desi
Citat: [Rd]Dzoni poslato Maj 07, 2013, 19:42:51 POSLE PODNE
nista se ne desi
Sta ti kucas kada pokusavas da nesto otvoris?
Posto vidim sta pise ovamo Koriscenje: /agl [name] [playerID/DeoImena]
A u kodu je obrnuto tako da treba da kucas ovako:
Koriscenje:
/agl [playerID/DeoImena] [name] tim redosledom, a ako kucas kao ono prvo onda prvo probaj onako kako sam ti ja dao skriptu, a ako ne radi onda probaj ono staro tvoje AKO si kucao kao ono prvo...
Sad cu da probam pa ti javljam
Ni jedno ni drugo nece da radi napisem stisnem enter i nista,cak nista ni nepise
dali imas na pocetku skripte ovo definisano
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
i dali ijednu koristis komandu u strcmp sem ove ?
Mislim da nemam,ajde molim te tacno mi to na pisi
Citat: |EG|#include <KuNNa> poslato Maj 07, 2013, 20:04:17 POSLE PODNE
dali imas na pocetku skripte ovo definisano
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
i dali ijednu koristis komandu u strcmp sem ove ?
sta cemu dcmd, ako koristi cmd??
Malo bolje pogleda i vidis da koristi strcmp neka vrati strcmp komandu da ne prebacuje u zcmd znaci da ostavi kako je bila i da je stavi pod OnPlayerCommandPerformed... to mu treba da si malo bolje pogledao skonto inace meni strcmp nerade bez toga :D :P
ps. isto ovako dodaj na vrh #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
ako nebude radilo provjeri da li na vrhu OnPlayerCommandPerformed
new string[256];
new sendername[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
Citat: |EG|#include <KuNNa> poslato Maj 07, 2013, 20:51:33 POSLE PODNE
Malo bolje pogleda i vidis da koristi strcmp neka vrati strcmp komandu da ne prebacuje u zcmd znaci da ostavi kako je bila i da je stavi pod OnPlayerCommandPerformed... to mu treba da si malo bolje pogledao skonto inace meni strcmp nerade bez toga :D :P
ps. isto ovako dodaj na vrh #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
ako nebude radilo provjeri da li na vrhu OnPlayerCommandPerformed
new string[256];
new sendername[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
KuNNa ispravka , stavi ovako i radit će ti :)Na vrhu skripte dodaj#include <zcmd>
IznadOnPlayerCommandText
Ovakopublic OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success) return 1;
else return OnPlayerCommandText(playerid, cmdtext);
}
public OnPlayerCommandText(playerid, cmdtext[])
...
I na kraju skripte dodaješ komande.
Koliko sam ja skonto njemu sve ostale cmd u zcmd hoce sem ove neka proba ovako kosto sam mu reko u strcmp
Moze LOCK! [BC:RP] Mr.Gagi Hvala na pomoci brate .
Nema na cemu.
problem resen, lock