10.12.2014, 08:26
Hi.
I've been struggling with this bug for like an hour, it wasted time. I have no clue what to do in it..
When I do /setplace 0, it sets it to place 0, cool, it works.
But if I did /setplace 1, nothing happens, not even a message appears.
Variables:
Note; I've used if statements for placeid 0 and 1, same result.
I've been struggling with this bug for like an hour, it wasted time. I have no clue what to do in it..
When I do /setplace 0, it sets it to place 0, cool, it works.
But if I did /setplace 1, nothing happens, not even a message appears.
Variables:
pawn Код:
new DefautlPlace = 0;
new ServerPlace;
pawn Код:
CMD:setplace(playerid, params[])
{
new placeid, string[128];
if(IsPlayerAdmin(playerid)|| PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", placeid)) return SendClientMessage(playerid, GREY, "Usage: /setplace [id] | 0: Area 51 | 1: San Fierro | more soon ");
//if(placeid == ServerPlace) return SendClientMessage(playerid, RED, "This is the current place!");
if(placeid != ServerPlace)
{
switch(placeid)
{
case 0:
{
TextDrawHideForAll(Textdraw1);
format(string,sizeof(string),"Admin "COL_PINK"%s (%d)"COL_WHITE" has set playing place to "COL_PINK"0 (Area 51)", GetName(playerid), playerid);
SendClientMessageToAll(WHITE, string);
TextDrawSetString(Textdraw1, "PLACE: ~r~Area 51");
TextDrawShowForAll(Textdraw1);
ServerPlace = 0;
DefaultPlace = -1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
}
}
case 1:
{
TextDrawHideForAll(Textdraw1);
format(string,sizeof(string),"Admin "COL_PINK"%s (%d)"COL_WHITE" has set playing place to "COL_PINK"1 (San Fierro)", GetName(playerid), playerid);
SendClientMessageToAll(WHITE, string);
TextDrawSetString(Textdraw1, "PLACE: ~r~San Fierro");
TextDrawShowForAll(Textdraw1);
ServerPlace = 1;
DefaultPlace = -1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
}
}
}
}
}
else
{
SendClientMessage(playerid, RED, "You're not an admin");
}
return 1;
}