SA-MP Forums Archive
/hotwire help need .. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /hotwire help need .. (/showthread.php?tid=279314)



/hotwire help need .. - antsolen - 26.08.2011

Hey i have command
Код:
if(!strcmp(cmd, "/hotwire", true))
	{
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					return 1;



	}
How i can make this to Job id 5
i already tried
Код:
if(!strcmp(cmd, "/hotwire", true))
	{
        if(PlayerInfo[playerid][pJob] == 5)
        {
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					return 1;



	}



Re: /hotwire help need .. - Gagi_Corleone - 26.08.2011

You forgot to put a bracket. Try this:
Код:
if(!strcmp(cmd, "/hotwire", true))
	{
        if(PlayerInfo[playerid][pJob] == 5)
        {
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					}
					return 1;
	}



Re: /hotwire help need .. - antsolen - 26.08.2011

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
You forgot to put a bracket. Try this:
Код:
if(!strcmp(cmd, "/hotwire", true))
	{
        if(PlayerInfo[playerid][pJob] == 5)
        {
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					}
					return 1;
	}
Added bracket , and now panwo crashes when i compile....?


Re: /hotwire help need .. - =WoR=G4M3Ov3r - 26.08.2011

PHP код:
if(!strcmp(cmd"/hotwire"true))
    {
        if(
PlayerInfo[playerid][pJob] != 5)
        {
        if(
engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Engine already started!");
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Your key Please");
        if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Only the driver can do this!");
        if(
IsAtDealership(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Do you Think you can steal this car");
        if(
pveh == 510) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"You don't need to start a bike!");
        if(
pveh == 462) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"You don't need to start a bike!");
        if(
idcar == 59 || idcar == 60) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Access denied!");
        if(
IsAtCarrental(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Do you Think you can steal this car");
                    new 
playerveh GetPlayerVehicleID(playerid);
                    
PutPlayerInVehicle(playeridplayerveh0);
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* %s tries to hotwire the car"sendername);
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
                    
GameTextForPlayer(playerid"~w~Hotwiring The Vehicle...",3500,3);
                    
gEngine[playerid] = 1;
                    return 
1;
    } 



Re: /hotwire help need .. - antsolen - 26.08.2011

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
PHP код:
if(!strcmp(cmd"/hotwire"true))
    {
        if(
PlayerInfo[playerid][pJob] ==! 5)
        {
        if(
engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Engine already started!");
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Your key Please");
        if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Only the driver can do this!");
        if(
IsAtDealership(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Do you Think you can steal this car");
        if(
pveh == 510) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"You don't need to start a bike!");
        if(
pveh == 462) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"You don't need to start a bike!");
        if(
idcar == 59 || idcar == 60) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Access denied!");
        if(
IsAtCarrental(playerid)) return SendClientMessage(playeridCOLOR_LIGHT_BLUE"Do you Think you can steal this car");
                    new 
playerveh GetPlayerVehicleID(playerid);
                    
PutPlayerInVehicle(playeridplayerveh0);
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* %s tries to hotwire the car"sendername);
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
                    
GameTextForPlayer(playerid"~w~Hotwiring The Vehicle...",3500,3);
                    
gEngine[playerid] = 1;
                    return 
1;
    } 
and now wtf
Код:
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(1723) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(1752) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(1788) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(1789) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(1816) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2287) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2298) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2310) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2314) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2326) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2330) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2334) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2338) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2342) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2346) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2350) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2354) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2366) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2370) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2374) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2378) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2382) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2394) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2398) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2402) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Andero\Desktop\RPEEE\gamemodes\gtarp.pwn(2414) : error 004: function "PlayerToPoint" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.



Re: /hotwire help need .. - antsolen - 26.08.2011

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
You forgot to put a bracket. Try this:
Код:
if(!strcmp(cmd, "/hotwire", true))
	{
        if(PlayerInfo[playerid][pJob] == 5)
        {
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					}
					return 1;
	}
Ooh sorry its working now !!
dint saw that
Код:
{
        if(PlayerInfo[playerid][pJob] == 5)
        { <------
Added rep to you

Now how i add like that if player dont have job 5 and tries to use command /hotwire then text appears , You are not car jacker ? I tried to make it myself but not working ..


Re: /hotwire help need .. - Gagi_Corleone - 26.08.2011

Код:
if(!strcmp(cmd, "/hotwire", true))
	{
        if(PlayerInfo[playerid][pJob] != 5) return SendClientMessage(playerid,-1,"You are not car jacker");
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
		if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");
		if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
		if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
		if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Do you Think you can steal this car");

		            new playerveh = GetPlayerVehicleID(playerid);
					PutPlayerInVehicle(playerid, playerveh, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
					GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
					gEngine[playerid] = 1;
					return 1;
	}