16.06.2010, 11:27
please tell me how to add in nitro in cars i want /nos for admins only ...my GM has admin cmds in it so yh no FS unless it will be to hard and just do a new FS with /nos alone? plese help gimme code i hate being noob
//givenos if(strcmp(cmd, "/givenos", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 1) { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); SendClientMessage(playerid,COLOR_YELLOW,"Dodali ste NOS u vozilo."); } else { SendClientMessage(playerid,COLOR_GREY, "Niste Admin !"); return 1; } } }
Originally Posted by Zero[S
]
Код:
//givenos if(strcmp(cmd, "/givenos", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 1) { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); SendClientMessage(playerid,COLOR_YELLOW,"Dodali ste NOS u vozilo."); } else { SendClientMessage(playerid,COLOR_GREY, "Niste Admin !"); return 1; } } } |
C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(2) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(4) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(6) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(9) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(11) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(12) : error 054: unmatched closing brace ("}") C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(13) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(16) : error 010: invalid function or declaration C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(19) : warning 203: symbol is never used: "vehicleid" C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\nos.pwn(19) : error 013: no entry point (no public functions) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
Originally Posted by MadeMan
|
if(strcmp(cmdtext, "/addnos", true) == 0) { if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_GREY, "Niste Admin !"); new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); SendClientMessage(playerid,COLOR_YELLOW,"Dodali ste NOS u vozilo."); return 1; }
Originally Posted by MadeMan
Did you try DJDhan code?
|
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" nos."); print("--------------------------------------\n"); new UnmodifiableVehicles[29] = { 581,523,462,521,463,522,461,448,468,586, 509,481,510,472,473,493,595,484,430,453, 452,446,454,590,569,537,538,570,449 }; forward IsPlayerInInvalidNosVehicle( playerid ); public IsPlayerInInvalidNosVehicle( playerid ) { new carid = GetPlayerVehicleID( playerid ); new carmodel = GetVehicleModel(carid); for (new i = 0; i < sizeof( UnmodifiableVehicles ); i++ ) { if( carmodel == UnmodifiableVehicles[i] ) return 1; } return 0; } if(strcmp("/nos", cmdtext, true) == 0) { if(IsPlayerInVehicle(playerid)) { if(IsPlayerInInvalidNosVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, "Sorry, you can't install NOS on this vehicle."); } else { AddVehicleComponent(vehicleid, 1010); } } else { SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle."); } return 1; } #endif