if(strcmp(cmd, "/unfreeze", true) == 0){
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /unfreeze [playerid]");
return 1;
}
new victim;
victim = strval(tmp);
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
format(string, sizeof(string), "%s unfrozed you.", playername);
SendClientMessage(victim, COLOUR_YELLOW, string);
TogglePlayerControllable(victim, 1);
format(string, sizeof(string), "You unfrozed %s.", playername2);
SendClientMessage(playerid, COLOUR_YELLOW, string);
return 1;
}
if(strcmp(cmd, "/freeze", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /freeze [playerid]");
return 1;
}
new victim;
victim = strval(tmp);
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
format(string, sizeof(string), "%s froze you.", playername);
SendClientMessage(victim, COLOUR_YELLOW, string);
TogglePlayerControllable(victim, 0);
format(string, sizeof(string), "You froze %s.", playername2);
SendClientMessage(playerid, COLOUR_YELLOW, string);
return 1;
}
Do you mean, like if a person is frozen you cant do it to them /froze [pid]
|
if(strcmp(cmd, "/unfreeze", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /unfreeze [playerid]");
return 1;
}
new victim;
victim = strval(tmp);
if(GetPVarInt(victim, "frozen") == 0) return SendClientMessage(playerid, COLOUR_ORANGE, "Hes not frozen.");
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
SetPVarInt(victim, "frozen", 0);
format(string, sizeof(string), "%s unfrozed you.", playername);
SendClientMessage(victim, COLOUR_YELLOW, string);
TogglePlayerControllable(victim, 1);
format(string, sizeof(string), "You unfrozed %s.", playername2);
SendClientMessage(playerid, COLOUR_YELLOW, string);
return 1;
}
if(strcmp(cmd, "/freeze", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /freeze [playerid]");
return 1;
}
new victim;
victim = strval(tmp);
if(GetPVarInt(victim, "frozen") == 1) return SendClientMessage(playerid, COLOUR_ORANGE, "Hes frozen!.");
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
SetPVarInt(victim, "frozen", 1);
format(string, sizeof(string), "%s froze you.", playername);
SendClientMessage(victim, COLOUR_YELLOW, string);
TogglePlayerControllable(victim, 0);
format(string, sizeof(string), "You froze %s.", playername2);
SendClientMessage(playerid, COLOUR_YELLOW, string);
return 1;
}
pawn Код:
|