add nos
#1

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
Reply
#2

Код:
//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;
			}
		}
	}
Reply
#3

Quote:
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.
Reply
#4

Put it under OnPlayerCommandText.

https://sampwiki.blast.hk/wiki/OnPlayerCommandText
Reply
#5

Quote:
Originally Posted by MadeMan
Put it under OnPlayerCommandText.

https://sampwiki.blast.hk/wiki/OnPlayerCommandText
nvm i got it to work
forgot the samp thing on top lol
now gonna test in-game
Reply
#6

Код:
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;
}
Reply
#7

i keep getting unknown command?
Reply
#8

why am i always the idiot lol any more helps?it compiled.. i get unknown cmds in game besides what does those spanish line means? oh and i wanna add in spawn weapons comands..thx
Reply
#9

Did you try DJDhan code?
Reply
#10

Quote:
Originally Posted by MadeMan
Did you try DJDhan code?
yes but same thing unknown command in game ..well i tried another that on a topic which they said worked...
Код:
// 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
but still unknown cmd :O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)