28.10.2012, 17:16
Wrong man, you should put it inside of a command. For example:
EDIT:
Command for getting our of the Interior(15):
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tpme", cmdtext, true, 5) == 0)
{
SetPlayerInterior(playerid, 15);
SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);
SendClientMessage(playerid, -1, "Teleported!");
return 1;
}
return 0;
}
Command for getting our of the Interior(15):
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tpme", cmdtext, true, 5) == 0)
{
SetPlayerInterior(playerid, 15);//Setting the player's Interior to 15 so the Motel can be visible.
SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);//Teleporting the player to the Motel's Pos.
SendClientMessage(playerid, -1, "Teleported!");//Sending the player a message.
return 1;
}
if(strcmp("/getmeout", cmdtext, true, 9) == 0)
{
SetPlayerInterior(playerid, 0);//Setting the player's Interior to 0(default one).
SetPlayerHealth(playerid, 0);//Setting the player's health to 0. Which will obviously kill him.
SendClientMessage(playerid, -1, "Done..");//Sending him a message saying that the command did what it was ment to do :p..
return 1;
}
return 0;
}