Spawning any object in game
#10

pawn Код:
COMMAND:object(playerid, params[])
{
    if(!APlayerData[playerid][LoggedIn]) return SendClientMessage(playerid, -1, "You must be logged in to use this command.");
    if(APlayerData[playerid][PlayerLevel] < 5) return SendClientMessage(playerid, -1, "Only Level 5+ Administrators can use this command.");
    new ObjectModel;
    if(sscanf(params, "i", ObjectModel)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/object <ObjectModel>\"");
    new Float:ploc[4];
    GetPlayerPos(playerid, ploc[0], ploc[1], ploc[2]);
    GetPlayerFacingAngle(playerid, ploc[3]);
    new fstr[95];
    format(fstr, sizeof(fstr), "You spawned object-id %i (model-id = %i) at coords: x=%.2f, y=%.2f, z=%.2f",
        CreateObject(ObjectModel, ploc[0], ploc[1], ploc[2], 0.0, 0.0, ploc[3]), ObjectModel, ploc[0], ploc[1], ploc[2]);
    SendClientMessage(playerid, 0x00FF00FF, fstr);
    return 1;
}
You need to send the client a message using SendClientMessage rather than returning 0. This way, you can let the player know what they need to change in order to use the command.
Reply


Messages In This Thread
Spawning any object in game - by Jhony_Blaze - 29.11.2014, 20:38
Re: Spawning any object in game - by Pottus - 29.11.2014, 20:43
Re: Spawning any object in game - by JeaSon - 29.11.2014, 20:44
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 21:02
Re: Spawning any object in game - by JeaSon - 29.11.2014, 21:09
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 21:33
Re: Spawning any object in game - by JeaSon - 29.11.2014, 21:48
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 22:18
Re: Spawning any object in game - by JeaSon - 29.11.2014, 22:21
Re: Spawning any object in game - by Threshold - 29.11.2014, 22:56

Forum Jump:


Users browsing this thread: 1 Guest(s)