12.12.2013, 18:02
first at the top of script
then as example cmd
pawn Код:
// at OnGameModeInt
new gate = CreateObject(modelID, X, Y, Z, X rotation, Y rotation, Z rotation, DrawDistance); // you may use samp map editor or if mta map editor, use http://www.convertffs.com to convert an object from mta to samp..
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gate", true))
{
if(IsPlayerInRangeOfPoint(playerid, float:distance, x, y, z)) // check if the player at the place
{
SetObjectPos(gate, X, Y,Z); // you can get the pos when you create the gate opens
}
else // if other
{
SendClientMessage(playerid, RED, "You are not near the gate!");
}
return 1;
}
return 0;
}