12.08.2010, 09:18
hi, im making a command /swap, i want that with this command i can disable enable one thing, but when i type /swap i got a sign that command have been turned on and server unknow command. when i type second time i got a sign auto swap turned off and auto swap turned on and server unknown command... whats the problem? here is the code:
dcmd_swap(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not adminstrator");
if(Swapas == 0)
{
Swapas = 1;
SendClientMessage(playerid, COLOR_LIME, "Auto swap have been turned off");
}
if(Swapas == 1)
{
Swapas = 0;
SendClientMessage(playerid, COLOR_LIME, "Auto swap have been turned on");
}
return 1;
}
Please help me.
dcmd_swap(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not adminstrator");
if(Swapas == 0)
{
Swapas = 1;
SendClientMessage(playerid, COLOR_LIME, "Auto swap have been turned off");
}
if(Swapas == 1)
{
Swapas = 0;
SendClientMessage(playerid, COLOR_LIME, "Auto swap have been turned on");
}
return 1;
}
Please help me.