SA-MP Forums Archive
Freeze Command. - 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: Freeze Command. (/showthread.php?tid=568710)



Freeze Command. - BlueEyes - 24.03.2015

Hi Niggas,I have made freeze command i have add GameTextForPlayer and SendClientMessage But In Game The message doesn't comes wtf is this please help me.
This Is My Code:
Tell me whats mistake in this script
PHP код:
CMD:freeze(playerid,params[])
{
    new 
TargetID;
    if(!
IsPlayerAdmin(playerid))
    {
    
SendClientMessage(playerid,COLOR_ERROR,"Unknown Command! Use /cmds For Available Commands.");
    return 
1;
    }
     if(
sscanf(params"u"TargetID))
    {
    
SendClientMessage(playeridCOLOR_ERROR"USAGE: /freeze (Name/ID)");
    return 
1;
    }
    if(!
IsPlayerConnected(TargetID) || TargetID == INVALID_PLAYER_ID)
    {
    
SendClientMessage(playeridCOLOR_ERROR"That Player Is Not Connected.");
    return 
1;
    }
    if(
IsPlayerNPC(TargetID))
    {
    
SendClientMessage(playerid,COLOR_ERROR,"You Cannot Freeze a BOT.");
    return 
1;
    }
    
SendClientMessageToAll(COLOR_ADMIN,"Admin Freeze %s(%d) Has Been Freezed By An Admin.");
    
GameTextForPlayer(TargetID,"~r~Freezed By An ~h~~p~Admin",4500,4);
    
TogglePlayerControllable(TargetID0);
    return 
1;




Re: Freeze Command. - SickAttack - 24.03.2015

Try this:
pawn Код:
new string[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin Freeze %s(%d) Has Been Freezed By An Admin.", name, playerid);
SendClientMessageToAll(COLOR_ADMIN, string);



Re : Freeze Command. - iFiras - 24.03.2015

Deleted.


Re: Freeze Command. - BlueEyes - 25.03.2015

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Try this:
pawn Код:
new string[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin Freeze %s(%d) Has Been Freezed By An Admin.", name, playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
Thanks You Very Much I Did It