02.01.2012, 14:17
How can i make it so that when u spawn as a police not a trucker, u receive a pistol?
public OnPlayerSpawn(playerid)
{
new pSkin = GetPlayerSkin(playerid);
switch (pSkin)
{
case 280..284: // Cop skins
{
GivePlayerWeapon(playerid, 22, 500);
}
}
return 1;
}
: warning 217: loose indentation 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);
}
}
for (new i; i < 12; i++)
{GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);}
GivePlayerWeapon(playerid, 22, 500);
case ClassPolice: // Police class