02.10.2010, 06:47
pawn Код:
}
if(strcmp(cmd, "/unprison",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " you are not authorized to use this command!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unprison [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "You unprisoned %s (%d).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You have been unprisoned by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_ORANGE, string);
PlayerInfo[giveplayerid][pJailTime] = 0;
PlayerInfo[giveplayerid][pJailed] = 0;
TextDrawHideForPlayer(giveplayerid, Textdraw1[giveplayerid]);
SetPlayerWorldBounds(giveplayerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
SafeSetPlayerPos(giveplayerid, 93.4852,1920.6235,18.0450);
format(string, sizeof(string), "%s (%d), has been unprisoned by %s.", giveplayer, giveplayerid, sendername);
SendClientMessageToAll(COLOR_NICERED,string);
format(string, 256, "[ADMIN]: %s (%d), has been un-prisoned by %s.", giveplayer, giveplayerid, sendername);
ABroadCast(COLOR_LIGHTRED,string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Removed %s From Prison.",d,m,y,h,mi,s,sendername,giveplayer);
JailLog(string);
}
}
}
return 1;
}
if(strcmp(cmd, "/unjail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [playerid/PartOfName] <reason>");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pJailed] >= 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Unjailed %s, No Reason Given",d,m,y,h,mi,s,sendername,giveplayer);
JailLog(string);
PlayerInfo[giveplayerid][pJailTime] = 0;
format(string, sizeof(string), "%s (%d), Has been unjailed by Administrator %s", giveplayer, giveplayerid, sendername);
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[ADMIN]: %s has unjailed %s (%d), No Reason Given",sendername,giveplayer,giveplayerid);
SendAdminMessage(COLOR_LIGHTRED, string);
GameTextForPlayer(giveplayerid, "~g~~h~Unjailed: ~n~~g~No Reason Given", 6000, 3);
return 1;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Unjailed %s for: %s",d,m,y,h,mi,s,sendername,giveplayer, (result));
JailLog(string);
PlayerInfo[giveplayerid][pJailTime] = 0;
format(string, sizeof(string), "%s (%d), Has been unjailed by Administrator %s", giveplayer, giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[ADMIN]: %s has unjailed %s (%d) for %s",sendername,giveplayer,giveplayerid,(result));
SendAdminMessage(COLOR_LIGHTRED, string);
format(string, sizeof(string), "~g~~h~Unjailed: ~n~~g~%s",(result));
GameTextForPlayer(giveplayerid, string, 6000, 3);
return 1;
}
}
}
}
else
{
format(string, sizeof(string), "** %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
D:\Lataukset\Server\Server\MRP\gamemodes\mrp.pwn(2 1215) : error 017: undefined symbol "Textdraw1"
D:\Lataukset\Server\Server\MRP\gamemodes\mrp.pwn(2 1215) : warning 215: expression has no effect
D:\Lataukset\Server\Server\MRP\gamemodes\mrp.pwn(2 1215) : error 001: expected token: ";", but found "]"
D:\Lataukset\Server\Server\MRP\gamemodes\mrp.pwn(2 1215) : error 029: invalid expression, assumed zero
D:\Lataukset\Server\Server\MRP\gamemodes\mrp.pwn(2 1215) : fatal error 107: too many error messages on one line
pawn Код:
Line 21215
TextDrawHideForPlayer(giveplayerid, Textdraw1[giveplayerid]);