28.06.2011, 17:22
If you want ...
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/savex", true) == 0)
{
SendClientMessage(playerid, 0xFFFF00FF, "Positions saved.");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPVarFloat(playerid, "X", Pos[0]);
SetPVarFloat(playerid, "Y", Pos[1]);
SetPVarFloat(playerid, "Z", Pos[2]);
SetPVarInt(playerid, "Int", GetPlayerInterior(playerid));
return 1;
}
if(strcmp(cmdtext, "/go", true) == 0)
{
if(GetPVarType(playerid, "X") == 0)
return SendClientMessage(playerid, 0xFF0000FF, "No positions saved.");
SendClientMessage(playerid, 0xFFFF00FF, "Teleported.");
SetPlayerPos(playerid, GetPVarFloat(playerid, "X"), GetPVarFloat(playerid, "Y"), GetPVarFloat(playerid, "Z"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "Interior"));
return 1;
}
return 0;
}