SA-MP Forums Archive
/home error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /home error (/showthread.php?tid=75034)



/home error - JoeDaDude - 28.04.2009

I want a command, So when you type /home
It teleports you to your house selected,
I have a code but it has loads of unusual errors,
Does anyone know the correct code for this?
I want it so when you type /home and your name is Michael
It teleports you to your house, But if your name is Joe,
It teleports you to a diffrent house but using the same command,
Can anyone fix this code,

pawn Код:
if( !strcmp(cmdtext,"/home",true ))
        {
        new name[24];
        GetPlayerName(playerid,name,24);
        if(strcmp(name, "Michael", false) == 0)
        {
        SetPlayerPos(playerid, 2503.489014, -7967.976074, 1.326540);
        return 1;
        }



Re: /home error - shitbird - 28.04.2009

It sounds like you've got the same command twice.


Re: /home error - JoeDaDude - 28.04.2009

I get not implented errors but they are


Re: /home error - Bearfist - 28.04.2009

Try this =)


Код:
   if( strcmp(cmdtext,"/home",true )== 0)
	    {
		new name[24];
		GetPlayerName(playerid,name,24);
		if(strcmp(name, "Michael", false) == 0)
 		{
        SetPlayerPos(playerid, 2503.489014, -7967.976074, 1.326540);
        SetPlayerInterior(playerid, Here the number ) 
        //In houses the interior is different but when you aren't in a house or building it is always 0
        //when you want to get the interior of the house go in it and type /interior 
		return 1;
		}
        else if(strcmp(name,"Joe",false) == 0)
        {
        SetPlayerPos(playerid,blablabla);
        SetPlayerInterior(playerid,blablabla);
        }
        else 
        {
        //what to do with gusy that haven't a name like micheal or joe ? 
        //maybe:
        SendClientMessage(playerid,COLOR_RED,"You aren't allowed to use this command!");
        }
        return 1;
    }
PS: You forgot a } (that gives loooots of errors) and also you didn't set Interior.... maybe the command had worked with the }
but you only would have seen your player..nothing more....
So for teleport always use: SetPlayerInterior(playerid, Interior);..
Hope it works =)


Bearfist