Ich habe für die Cops den Befehl /duty schon gemacht, doch ich will, dass sie nur in den Copfahrzeugen on duty können und auch off duty. Ich möchte am liebsten z. B. wie "if(IsPlayerInVehicle...)" einfach in if(IsPlayerInModel) oder sowas, wenn sowas existiert. Und kann ich auch, dass man wenn man schon on duty ist, und nochmals /duty macht, dass dann die waffen weggehen und nicht nochmals die Waffen bekommen. Momentaner Script zu Duty:
if(strcmp("/duty", cmdtext, true) == 0)
{
if(gTeam[playerid] == TEAM_ARMY)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Soldat %s ist im Dienst.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerColor(playerid, 0x33AA33AA);
SetPlayerArmour(playerid, 100.0);
GivePlayerWeapon(playerid, 16, 10);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 500);
}
else if(gTeam[playerid] == TEAM_COPS)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Polizist %s ist im Dienst.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerColor(playerid, BLUE);
SetPlayerArmour(playerid, 100.0);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 41, 500);
GivePlayerWeapon(playerid,3, 1);
}
else if(gTeam[playerid] == TEAM_SWAT)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "SWAT Mitglied %s ist im Dienst.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerColor(playerid,COLOUR_BLUE);
SetPlayerArmour(playerid, 100.0);
GivePlayerWeapon(playerid, 29, 200);
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid,31, 100);
GivePlayerWeapon(playerid,34, 50);
}
else
{
GameTextForPlayer(playerid,"Du bist kein Soldat/Cop/S.W.A.T. Mitglied!",1000,1);
}
}
Momentaner Script zu Off Duty:
if(strcmp("/offduty",cmdtext,true) == 0)
{
if(gTeam[playerid] == TEAM_ARMY)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Soldat %s macht Feierabend.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerArmour(playerid,0);
SetPlayerColor(playerid,COLOR_WHITE);
ResetPlayerWeapons(playerid);
}
else if(gTeam[playerid] == TEAM_COPS)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Polizist %s macht Feierabend.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerArmour(playerid,0);
SetPlayerColor(playerid,COLOR_WHITE);
ResetPlayerWeapons(playerid);
}
else if(gTeam[playerid] == TEAM_SWAT)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "SWAT Mitglied %s macht Feierabend.", name );
SendDistancedClientMessage(playerid, 40,string, 0x800080AA,0x800080AA,0x800080AA,0x800080AA,0x800080AA);
SetPlayerArmour(playerid,0);
SetPlayerColor(playerid,COLOR_WHITE);
ResetPlayerWeapons(playerid);
}
else
{
GameTextForPlayer(playerid,"Du bist kein Soldat/Polizist/S.W.A.T. Mitglied!",3000,1);
}
}
Bitte helft mir