Police with pistol
#1

How can i make it so that when u spawn as a police not a trucker, u receive a pistol?
Reply
#2

Code:
public OnPlayerSpawn(playerid)
{
	new pSkin = GetPlayerSkin(playerid);
	switch (pSkin)
	{
		case 280..284: // Cop skins
		{
			GivePlayerWeapon(playerid, 22, 500);
		}
	}
	return 1;
}
That's one of the many ways to do this.
Reply
#3

C:\Users\me\Desktop\PPC_Trucking6[1]\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(63 : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Code:
		case ClassPolice: // Police class
		{
			format(missiontext, sizeof(missiontext), Police_NoJobText); // Preset the missiontext
			SetPlayerColor(playerid, ColorClassPolice); // Set the playercolor (chatcolor for the player and color on the map)
			// Start the PlayerCheckTimer to scan for wanted players (be sure the timer has been destroyed first)
			KillTimer(APlayerData[playerid][PlayerCheckTimer]);
			APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid);
			// Check if the police player can get weapons
			if (PoliceGetsWeapons == true)
			{
			    // Give up to 12 weapons to the player
				for (new i; i < 12; i++)
				    GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
	CASE 638			    GivePlayerWeapon(playerid, 22, 500);
			}
		}
Reply
#4

Change it to this:
Code:
for (new i; i < 12; i++)
	{GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);}
GivePlayerWeapon(playerid, 22, 500);
Reply
#5

it didnt give any errors but when i chose class police and spawned, didnt have pistol?
Reply
#6

any ideas?
Reply
#7

Code:
case ClassPolice: // Police class
What is ClassPolice? What number? Can you show it to us? And the 'switch' code would be helpful too.
Reply
#8

what do you mean, what nubmer?
Reply
#9

I guess ClassPolice is a define, if it's a define, please show us that define. And the 'switch' function before your case function might be useful too. Just give us more information about your script. We don't know what the other conditions are, so we can't fix your problem until we have more of your script.
Reply
#10

im new with this .pwn scripts and i started of so i don't know where does that class locate? do u? somewhere in gamemodes?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)