08.01.2013, 16:35
use sscanf by ******.. search for the plugin and inc coz sscanf is fast!
and please next time use [ pawn ] code [ /pawn ]
pawn Код:
if(strcmp(cmd, "/setspawn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[256];
new id;
x_nr = strtok(cmdtext, idx);
if(sscanf(x_nr,"d",id)) {
SendClientMessage(playerid, COLOR_RED, "|__________________ Alege Spawn ___________|");
SendClientMessage(playerid, COLOR_RED, "/setspawn [1,2,3]");
SendClientMessage(playerid, COLOR_RED, "SetSpawn (1) - Acasa");
SendClientMessage(playerid, COLOR_RED, "SetSpawn (2) - Spawn Civil");
SendClientMessage(playerid, COLOR_RED, "SetSpawn (3) - Factiune");
SendClientMessage(playerid, COLOR_RED, "|____________________________________________ |");
return 1;
}
if(Spectate[playerid] != 255 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are Spectating, can't change the Spawn right now !");
return 1;
}
switch(id) {
case 1:
{
if(PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_RED, "Nu ai Casa");
return 1;
}
SendClientMessage(playerid, COLOR_RED, "Te vei respawna la casa ta,sau la chirie !");
SpawnChange[playerid] = 1;
OnPlayerUpdateEx(playerid);
return 1;
}
case 2:
{
SendClientMessage(playerid, COLOR_RED, "Te vei respawna la spawn civil !");
SpawnChange2[playerid] = 1;
OnPlayerUpdateEx(playerid);
return 1;
}
case 3:
{
if(PlayerInfo[playerid][pMember] != 0 || PlayerInfo[playerid][pLeader] != 0)
{
SendClientMessage(playerid, COLOR_RED, "Te vei respawna la factiunea ta !");
SpawnChange[playerid] = 0;
OnPlayerUpdateEx(playerid);
return 1;
} else return SendClientMessage(playerid, COLOR_RED, "Nu esti in nicio factiune !");
}
}
return 1;
}