CMD kil - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD kil (
/showthread.php?tid=630744)
CMD kil -
IceWizz - 18.03.2017
hello i making cmd kill but i get one error and this command dont work best in game
Код:
CMD:kill(playerid, params[])
{
if(IsPlayerAdmin(playerid == 1)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Koristi /kill [playerid]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Igrac koga pokusavate ubiti nije online!");
if (sscanf(params, targetid, "ui", SetPlayerHealth)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP] Ubijen si od strane admina!");
else if
(IsPlayerAdmin(playerid == 0)) return SendClientMessage (playerid, 0x33AA33AA, "[BA:RP]Niste ovlasceni da koristite ovu komandu!");
return 1;
}
errors
Код:
error 017: undefined symbol "targetid"
Re: CMD kil -
Unte99 - 18.03.2017
You have to create it first so you can use it.
Re: CMD kil -
IceWizz - 18.03.2017
bro can you help me with target id
Re: CMD kil -
Unte99 - 18.03.2017
Quote:
Originally Posted by IceWizz
bro can you help me with target id
|
I already did help you. I told you what's wrong.
Re: CMD kil -
IceWizz - 18.03.2017
to type new targetid ?
Re: CMD kil -
Unte99 - 18.03.2017
Quote:
Originally Posted by IceWizz
to type new targetid ?
|
Try it.
Re: CMD kil -
IceWizz - 18.03.2017
error
Код:
syntax error in the expression, or invalid function call
script
Код:
CMD:kill(playerid, params[])
{
if(IsPlayerAdmin(playerid == 1)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Koristi /kill [playerid]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Igrac koga pokusavate ubiti nije online!");
if (sscanf(params, "ui", SetPlayerHealth)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP] Ubijen si od strane admina!");
else if
(IsPlayerAdmin(playerid == 0)) return SendClientMessage (playerid, 0x33AA33AA, "[BA:RP]Niste ovlasceni da koristite ovu komandu!");
return 1;
}
Re: CMD kil -
Unte99 - 18.03.2017
And where did you create targetid?
Re: CMD kil -
IceWizz - 18.03.2017
new code
Код:
CMD:kill(playerid, params[])
{
if(IsPlayerAdmin(playerid == 1)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Koristi /kill [playerid]");
{
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Igrac koga pokusavate ubiti nije online!");
{
if(sscanf(params, "ui", SetPlayerHealth)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP] Ubijen si od strane admina!");
SetPlayerHealth(playerid, 0.0);
if(IsPlayerAdmin(playerid == 0)) return SendClientMessage (playerid, 0x33AA33AA, "[BA:RP]Niste ovlasceni da koristite ovu komandu!");
}
}
return 1;
}
errors
Код:
syntax error in the expression, or invalid function call
Re: CMD kil -
IceWizz - 18.03.2017
Код:
CMD:kill(playerid, params[])
{
new targetid;
{
if(IsPlayerAdmin(playerid == 1)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Koristi /kill [playerid]");
{
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0x33AA33AA, " [BA:RP]Igrac koga pokusavate ubiti nije online!");
{
if(sscanf(params, "ui", targetid, SetPlayerHealth)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP] Ubijen si od strane admina!");
SetPlayerHealth(playerid, 0.0);
if(IsPlayerAdmin(playerid == 0)) return SendClientMessage (playerid, 0x33AA33AA, "[BA:RP]Niste ovlasceni da koristite ovu komandu!");
}
}
return 1;
}
}
new code
errors again syntax error