22.09.2013, 15:18
Can any one give me /freeze, /freezeall and /unfreeze and /unfreezeall Command?
CMD:freeze(playerid,params[])
{
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /freeze [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
TogglePlayerControllable(id,0);
GameTextForPlayer(id,"~r~frozen",4000,4);
return 1;
}
CMD:unfreeze(playerid,params[])
{
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /unfreeze [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
TogglePlayerControllable(id,1);
GameTextForPlayer(id,"~r~unfrozen",4000,4);
return 1;
}
CMD:unfreezeall(playerid,params[])
{
foreach(new i:Player)
{
TogglePlayerControllable(i,1);
GameTextForPlayer(i,"~r~unfrozen",4000,4);
}
return 1;
}
CMD:freezeall(playerid,params[])
{
foreach(new i:Player)
{
TogglePlayerControllable(i,0);
GameTextForPlayer(i,"~r~frozen",4000,4);
}
return 1;
}
E:\SCRIPT\gamemodes\Gamemode.pwn(1326) : error 029: invalid expression, assumed zero
E:\SCRIPT\gamemodes\Gamemode.pwn(1326) : error 017: undefined symbol "Playerid"
E:\SCRIPT\gamemodes\Gamemode.pwn(1326) : error 029: invalid expression, assumed zero
E:\SCRIPT\gamemodes\Gamemode.pwn(1326) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
foreach(new i:Playerid)
foreach(new i:Player)
#include <a_samp>
#include <foreach>
#include <sscanf2>
#include <zcmd>
CMD:freeze(playerid,params[])
{
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /freeze [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
TogglePlayerControllable(id,0);
GameTextForPlayer(id,"~r~frozen",4000,4);
return 1;
}
CMD:unfreeze(playerid,params[])
{
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /unfreeze [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
TogglePlayerControllable(id,1);
GameTextForPlayer(id,"~r~unfrozen",4000,4);
return 1;
}
CMD:unfreezeall(playerid,params[])
{
foreach(new i:Player)
{
TogglePlayerControllable(i,1);
GameTextForPlayer(i,"~r~unfrozen",4000,4);
}
return 1;
}
CMD:freezeall(playerid,params[])
{
foreach(new i:Player)
{
TogglePlayerControllable(i,0);
GameTextForPlayer(i,"~r~frozen",4000,4);
}
return 1;
}