Command dont work properly - 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: Command dont work properly (
/showthread.php?tid=651197)
Command dont work properly -
Dejan12345 - 15.03.2018
Hello guys.
When i join game i type all of these and this work but when i try to /heal id 1 they said me he not in game but string says to me that id 1 is healed sry for my bad english
pawn Код:
CMD:heal(playerid,params[])
{
new targetid;
new name[MAX_PLAYER_NAME];
{
if(IsPlayerAdmin(playerid) == 0)
{
SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Niste ovlasteni da koristite ovu komandu!");
}
else if(IsPlayerAdmin(playerid) == 1)
{
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, -1,""CRVENA"[BD:RP]"BELA"Koristi /heal [ID]");
}
if(!IsPlayerConnected(targetid))
{
SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Trazeni igrac nije online!");
{
SetPlayerHealth(playerid,100);
new string[60];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string), ""CRVENA"[BD:RP]"BELA"Izlecili ste igraca %s!",name);
SendClientMessage(playerid,-1,string);
}
}
}
return 1;
}
Re: Command dont work properly -
Dejan12345 - 15.03.2018
FIXED
Re: Command dont work properly -
KaRToNiToS - 15.03.2018
You've already created a topic with the same question
https://sampforum.blast.hk/showthread.php?tid=651191
Re: Command dont work properly -
rolex - 15.03.2018
Use it:
PHP код:
CMD:heal(playerid,params[])
{
new targetid, name[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Niste ovlasteni da koristite ovu komandu!");
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, -1,""CRVENA"[BD:RP]"BELA"Koristi /heal [ID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1,"Player is not logged in!");
SetPlayerHealth(targetid,100);
new string[60];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string), ""CRVENA"[BD:RP]"BELA"Izlecili ste igraca %s!",name);
SendClientMessage(playerid,-1,string);
return 1;
}