SA-MP Forums Archive
Problem With /giveobject - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem With /giveobject (/showthread.php?tid=410955)



Problem With /giveobject - ahmed0016255 - 27.01.2013

i have got command /giveobject but when i type any object id it says invalid object, any one have any idea about weapons objects ids ?
Quote:

CMD:giveobject(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
new string[128], giveplayerid, object, slot;
if(sscanf(params, "udd", giveplayerid, object, slot)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveobject [playerid] [object] [slot]");

if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
if( (object > 1212 && object < 18658) || (object > 18668 && object < 18748) || (object > 18865 && object < 18975) ||
(object > 19006 && object < 19053) || (object > 19077 && object < 19120) || (object > 19136 && object < 19142) || (object > 19160 && object < 19163) || object == 19200 || object == 19274)
{
if (IsPlayerConnected(giveplayerid))
{
PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
format(string, sizeof(string), "You have given %s object %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
SendClientMessageEx(playerid, COLOR_YELLOW, string);
SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
}
}
return 1;
}