29.11.2014, 20:38
First of all I should let you know that I am not good at scripting, this is kinda what I've done and I'd need some help, I want a command that spawns any object in game.
Errors:
Please, give me some help, I'd appreciate it.
Код:
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, "iffff", ObjectModel, Float:plocx,Float:plocy,Float:plocz,Float:ploca)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/object <ObjectModel>\""); else { GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); ObjID = CreateObject(ObjectModel, Float:plocx,Float:plocy,Float:plocz,Float: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, x, y, z); SendClientMessage(playerid, 0x00FF00FF, Msg); } } else return 0; } else return 0; return 1; }
Код:
(14181) : error 001: expected token: ";", but found "if" (14192) : warning 202: number of arguments does not match definition (14192) : warning 202: number of arguments does not match definition (14194) : error 017: undefined symbol "x"