31.08.2011, 14:03
onplayerconnect
my spawn system
pawn Код:
SetPlayerColor(playerid,COLOR_GREY);
pawn Код:
//==============================================================================
//Bandit spawn
//==============================================================================
if(pickupid == banditpickupspawn)
{
SetPlayerPos(playerid, 696.0515,-1444.0397,13.5391);
gTeam[playerid] = TEAM_BANDIT;
SetPlayerColor(playerid,COLOR_ORANGE); // orange
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Joined team Bandits!",name);
SendClientMessageToAllBandits(string);
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Bandits!");
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SetPlayerWantedLevel(playerid, 0);
ResetPlayerWeapons(playerid);
SetTimer("bandwepstim", 300000, true);
if(IsLevel[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
SetPlayerSkin(playerid,BandSkinsL1[random(sizeof(BandSkinsL1))]);
GivePlayerWeapon(playerid, 30, 200); //slot 5
GivePlayerWeapon(playerid, 28, 500); //slot 4
GivePlayerWeapon(playerid, 24, 20); //slot 2
GivePlayerWeapon(playerid, 1, 0); //slot 2
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -car stealer- (/l1 for more info)");
}
if(IsLevel[playerid] == 2)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 50);
SetPlayerSkin(playerid,BandSkinsL2[random(sizeof(BandSkinsL2))]);
GivePlayerWeapon(playerid, 30, 400); //slot 5
GivePlayerWeapon(playerid, 28, 1000); //slot 4
GivePlayerWeapon(playerid, 24, 40); //slot 2
GivePlayerWeapon(playerid, 26, 50); //slot 3
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -Badass- (/l2 for more info)");
}
if(IsLevel[playerid] == 3)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,BandSkinsL3[random(sizeof(BandSkinsL3))]);
GivePlayerWeapon(playerid, 30, 800); //slot 5
GivePlayerWeapon(playerid, 28, 2000); //slot 4
GivePlayerWeapon(playerid, 24, 80); //slot 2
GivePlayerWeapon(playerid, 26, 100); //slot 3
GivePlayerWeapon(playerid, 18, 20); //slot 8
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -Maffia Boss- (/l3 for more info)");
}
}
//==============================================================================
//COP Spawn
//==============================================================================
if(pickupid == coppickupspawn)
{
SetPlayerPos(playerid, 1580.4596,-1634.8533,13.5612);
gTeam[playerid] = TEAM_COPS;
SetPlayerColor(playerid,COLOR_ROYALBLUE);
SetPlayerWantedLevel(playerid, 0);
ResetPlayerWeapons(playerid);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Joined team Cops!",name);
SendClientMessageToAllCops(string);
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Cops!");
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SetTimer("copwepstim", 300000, true);
if(IsLevel[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
SetPlayerSkin(playerid,CopSkinsL1[random(sizeof(CopSkinsL1))]);
GivePlayerWeapon(playerid, 23, 20); //slot 2
GivePlayerWeapon(playerid, 41, 1000); //slot 9
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -Cop- (/l1 for more info)");
}
if(IsLevel[playerid] == 2)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 50);
SetPlayerSkin(playerid,CopSkinsL2[random(sizeof(CopSkinsL2))]);
GivePlayerWeapon(playerid, 23, 40); //slot 2
GivePlayerWeapon(playerid, 41, 2000); //slot 9
GivePlayerWeapon(playerid, 29, 200); //slot 8
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -S.W.A.T.- (/l2 for more info)");
}
if(IsLevel[playerid] == 3)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,CopSkinsL3[random(sizeof(CopSkinsL3))]);
GivePlayerWeapon(playerid, 23, 80); //slot 2
GivePlayerWeapon(playerid, 41, 4000); //slot 9
GivePlayerWeapon(playerid, 29, 400); //slot 4
GivePlayerWeapon(playerid, 30, 400); //slot 5
GivePlayerWeapon(playerid, 34, 50); //slot 6
GivePlayerWeapon(playerid, 26, 200); //slot 3
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -FBI- (/l3 for more info)");
}
}
//==============================================================================
//Driver Spawn
//==============================================================================
if(pickupid == driverpickupspawn)
{
SetPlayerPos(playerid, 722.0700,-1276.4917,17.6484);
gTeam[playerid] = TEAM_DRIVERS;
SetPlayerColor(playerid,COLOR_SEXYGREEN);
SetPlayerWantedLevel(playerid, 0);
ResetPlayerWeapons(playerid);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Joined team Drivers!",name);
SendClientMessageToAllDrivers(string);
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Drivers!");
SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
SetTimer("drivwepstim", 300000, true);
if(IsLevel[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid, 22, 10); //slot 2
SetPlayerSkin(playerid,DrivSkinsL1[random(sizeof(DrivSkinsL1))]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -Chauffeur- (/l1 for more info)");
}
if(IsLevel[playerid] == 2)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 50);
GivePlayerWeapon(playerid, 22, 20); //slot 2
GivePlayerWeapon(playerid, 41, 20); //slot 9
SetPlayerSkin(playerid,DrivSkinsL2[random(sizeof(DrivSkinsL2))]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -Moderate Driver- (/l2 for more info)");
}
if(IsLevel[playerid] == 3)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,DrivSkinsL3[random(sizeof(DrivSkinsL3))]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -Security Chauffeur- (/l3 for more info)");
}
}
if(iPickups[pickupid] != 0){
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != 0){
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
}
}