25.04.2011, 00:48
Help ,i want script /enter and /exit,how to script that?
COMMAND:enter(playerid, params[])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPVarFloat(playerid, "LastPosX", X), SetPVarFloat(playerid, "LastPosY", Y), SetPVarFloat(playerid, "LastPosZ", Z);
SetPVarInt(playerid, "LastInterior", GetPlayerInterior(playerid));
return 1;
}
COMMAND:exit(playerid, params[])
{
SetPlayerPos(playerid, GetPVarFloat(playerid, "LastPosX"), GetPVarFloat(playerid, "LastPosY"), GetPVarFloat(playerid, "LastPosZ"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "LastInterior"));
return 1;
}
COMMAND:enter(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFF, "Enter");
}
COMMAND:exit(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFF, "Exit");
}
public OnGameModeInit() { CreateObject(1239,2045.5084228516,-1908.2283935547,12.99134349823,0,0,0); CreateObject(1239, -2029.9155273438, -119.97499084473, 1034.8000488281, 0, 0, 0); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext,"/enter",true) == 0) { if(IsPlayerInRangeOfPoint(playerid,5.0,2045.508422 8516,-1908.2283935547,12.99134349823)) { SetPlayerPos(playerid,-2029.9155273438,-119.97499084473,1034.8000488281); SetPlayerInterior(playerid,3); } return 1; } if (strcmp(cmdtext,"/exit",true) == 0) { if(IsPlayerInRangeOfPoint(playerid,5.0,-2029.9155273438,-119.97499084473,1034.8000488281)) { SetPlayerPos(playerid,2045.5084228516,-1908.2283935547,12.99134349823); SetPlayerInterior(playerid,0); } return 1; } |