29.11.2014, 20:44
try this
pawn Код:
COMMAND:object(playerid, params[])
{
// Setup local variables
new ObjectModel, ObjID, Msg[128], Float:plocx,Float:plocy,Float:plocz,Float:ploca;
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 5)
{
if (sscanf(params, "i", ObjectModel)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /object <ObjectModel>");
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
ObjID = CreateObject(ObjectModel, plocx, plocy, plocz, ploca);
// Inform the player about it
format(Msg, 128, "You spawned object-id %i (model-id = %i) at coords: x=%4.2f, y=%4.2f, z=%4.2f", ObjID, ObjectModel, plocx, plocy, plocz);
SendClientMessage(playerid, 0x00FF00FF, Msg);
}
else
return SendClientMessage(playerid, -1, "You are not logged in please login to continu");
}
else
return SendClientMessage(playerid, -1, "sorry you need to be admin to use this command");
return 1;
}