04.07.2015, 18:10
Hi guyz...
/addobject command dont spawns an object but we get message,"You have spawned.."
Here is the script:
/addobject command dont spawns an object but we get message,"You have spawned.."
Here is the script:
PHP код:
COMMAND:addobject(playerid, params[])
{
new ObjectID;
if(PlayerInfo[playerid][pSpawned] == 1)
{
if(PlayerInfo[playerid][pAdminlevel] > 0)
{
if(sscanf(params, "d", ObjectID))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /addobject (Object ID)");
return 1;
}
if(ObjectID >= 20000)
{
SendClientMessage(playerid, COLOR_ERROR, "Invalid Object ID.");
return 1;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerObjectCount[playerid]++;
PlayerObject[playerid][PlayerObjectCount[playerid]] = CreateDynamicObject(ObjectID, x + 6, y + 6, z + 0.5, 0.0, 0.0, 96.0);
new string[128];
format(string, sizeof string, "You Have Spawned Object ID %d. Editing ID %d.", ObjectID, PlayerObjectCount[playerid]);
SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
}else{
SendClientMessage(playerid,COLOR_ERROR,""ERROR_MSG"");
}
}else{
SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While You're Dead.");
}
return 1;
}