SA-MP Forums Archive
spawnchange command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: spawnchange command (/showthread.php?tid=548087)



spawnchange command - GuitarMan - 27.11.2014

So the thing is, i have a spawnchange command that lets you to choose if you want to spawn @ home or in your organization base. It's working fine unless i restart client. After reconnecting it automatically sets my spawn @ house. Any ideas how to fix it?
PHP код:
CMD:spawnchange(playeridparams[])
{
    if(
PlayerLogged[playerid] == 0) return 1;
       new 
house 0;
    for(new 
1<= TOTALHOUSE;i++)
    {
        if(!
strcmp(HouseInfo[i][hOwner],sendername(playerid),true)) house++;
    }
    if(
house != 0)
    {
        if(
SpawnChange[playerid] == trueSendClientMessage(playeridCOLOR_WHITE"Tagat jus atdzimsiet parastaja vieta!"), SpawnChange[playerid] = false;
        else 
SendClientMessage(playeridCOLOR_WHITE"Tagat jus atdzimsiet majas!"), SpawnChange[playerid] = true;
    }
    else 
SendClientMessage(playeridCOLOR_GREYPlayerDoNotHaveAtHome);
    return 
1;