Command dont work properly
#1

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;
}
Reply
#2

FIXED
Reply
#3

You've already created a topic with the same question

https://sampforum.blast.hk/showthread.php?tid=651191
Reply
#4

Use it:

PHP код:
CMD:heal(playerid,params[])
{
    new 
targetidname[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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)