28.06.2011, 15:24
I want to know if it's possible to make /save and /interior for rcon admins only , on my server. Is this possible ? can you show me how.
Thanks
Thanks
What are /save supposed to do? Save player pos (X, Y, Z, A) and Vehicle pos (if you are in a vehicle ofc..)
What are /interior supposed to do? A interior menu so you can teleport to different interiors? |
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;
}