hello how to create object with id so when i create object with command it got his own id
example object id: 10 Model id: 19510 etc... |
CMD:object(playerid, params[]) // zcmd command, change after what you use
{
new objectid; // Declares a variable called "objectid"
if(sscanf(params, "i", objectid)) return SendClientMessage( ... ); // If the player writes something after /object, like /object 10, it'll store what he wrote in "objectid"
// Otherwise if he didn't write anything, or wrote something that's not a number (since we defined "i" - integer) will return the message and stop the cmd
switch(objectid) // Checks the value of "objectid", AKA what number he wrote
{
case 10: CreateObject(19510, ... ); // If the number he wrote was 10, it will create object id 19510
// Likewise you can create more "case"'s to check what number he wrote, and create different objects
default: return SendClientMessage( ... ); // If the number he wrote isn't in the switch, it'll return and send him a msg
}
return 1;
}