Originally Posted by WellDoneNick
Quote:
Originally Posted by Nakki
I maked freeze and ufreeze commands.. but when i type /freeze (playerid) i freezed :S
Same thing when i type /unfreeze (playerid)
heres /freeze command
Код:
if(!strcmp(cmdtext, "/freeze", true, 5))
{
if (IsPlayerAdmin(playerid))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, COLOR_ORED, "Usage: /freeze [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new strv[170];
if(IsPlayerConnected(ID))
{
format(strv, 170, "~ Your have been freezed");
SendClientMessage(ID,COLOR_ORANGE, strv);
TogglePlayerControllable( ID ,0);
}
}
return SendClientMessage(playerid, COLOR_RED, "Your not rcon admin!");
}
|
Use this command's seems it works!
freeze- >
Код:
if(strcmp(cmd, "/freeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /freeze [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playa][pAdmin] > 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Admins can not be frozen");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 0);
format(string, sizeof(string), "AdmCmd/HlpCmd: %s Freezes %s",sendername, giveplayer);
printf("%s",string);
format(string, sizeof(string), "AdmCmd/HlpCmd: %s was Frozen by %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
unfreeze- >
Код:
if(strcmp(cmd, "/unfreeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unfreeze [playerid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "AdmCmd/HlpCmd: %s UnFroze %s",sendername, giveplayer);
printf("%s",string);
format(string, sizeof(string), "AdmCmd/HlpCmd: %s was UnFrozen by %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
|