public OnPlayerCommandText( playerid,cmdtext[]) { if(strcmp("/create [modelid]", cmdtext, true, 7) == 0) { SendClientMessage(playerid,0xFFFFFFFF,"you have entered a create command"); new modelid; GetPlayerPos(playerid, X, Y, Z); new Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ; CreateObject(modelid, X, Y, Z, rX, rY, rZ); return 1; } return 0; } |
CMD:create(playerid,params[])
{
new modelid;
if(isnull(params)) SendClientMessage(playerid,-1,"Usage: /create object_modelid");
else if(!IsValidObject((modelid = strval(params)))) SendClientMessage(playerid,-1,"Invalid modelid");
else{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateObject(modelid, X, Y, Z, 0.0, 0.0, 0.0);
}
return 1;
}
CMD:create(playerid, params[]) //this tells the server which command is being used { SendClientMessage(playerid,0xFFFFFFFF,"you have entered a create command"); //sends the client message to the player who typed this CMD new modelid; GetPlayerPos(playerid, X, Y, Z); // get the player current position new Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ; CreateObject(modelid, X, Y, Z, rX, rY, rZ); // creates an object at the player location return 1; //returns a value }
pawn Код:
|
Its So Simple:
Код:
CMD:create(playerid, params[]) //this tells the server which command is being used { SendClientMessage(playerid,0xFFFFFFFF,"you have entered a create command"); //sends the client message to the player who typed this CMD new modelid; GetPlayerPos(playerid, X, Y, Z); // get the player current position new Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ; CreateObject(modelid, X, Y, Z, rX, rY, rZ); // creates an object at the player location return 1; //returns a value } |