/home error
#1

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;
        }
Reply
#2

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

I get not implented errors but they are
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)