Was ist da falsch, weil wenn ich in die umkleide gehe als fbi leader und dann /duty mache, steht dort dass ich duty gehe aber wenn ich dann /su mache kommt dass ich nicht duty bin.
Hier das Script:
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s holt seine Sachen aus dem Spinnt.", sendername);
}
if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s holt seine Sachen aus dem Spinnt.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s schmeißt seine Sachen in den Spinnt.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s schmeißt seine Sachen in den Spinnt.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 0);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht in dem Umkleideraum !");
return 1;
}
}
Problem
- Soldtodie
- Geschlossen
- Erledigt
-
-
Hier ein richtiger Duty Befehl
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsACop(playerid))
{
if (IsPlayerInRangeOfPoint(playerid,3.0,227.6519,111.8072,1003.2188) ||IsPlayerInRangeOfPoint(playerid,3.0,255.3,77.4,1003.6)
|| IsPlayerInRangeOfPoint(playerid,3.0,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(playerid,3.0, 217.5230,184.4352,1003.0313)
|| IsPlayerInRangeOfPoint(playerid,3.0, 217.8921,78.9727,1005.0391)
|| PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "* Officer %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeapon(playerid, 41, 500); //spray
GivePlayerWeapon(playerid, 3, 1); //Nightstick
GivePlayerWeapon(playerid, 25, 100); //Shotgun
GivePlayerWeapon(playerid, 24, 500); //Desert Eagle
GivePlayerWeapon(playerid, 29, 500); //MP5
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "* Officer %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(giveplayerid);
PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keiner Umkleide !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
{
if (IsPlayerInRangeOfPoint(playerid,3.0,-1706.6536,1017.7665,17.5859))
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "* FBI-Agent %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeapon(playerid, 41, 500); //spray
GivePlayerWeapon(playerid, 3, 0); //Nightstick
GivePlayerWeapon(playerid, 25, 100); //Shotgun
GivePlayerWeapon(playerid, 24, 500); //Desert Eagle
GivePlayerWeapon(playerid, 29, 500); //MP5
GivePlayerWeapon(playerid, 33, 50); //County Rifle
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "* FBI-Agent %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(giveplayerid);
PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keiner Umkleide !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst und empfängst keine Notrufe mehr.");
JobDuty[playerid] = 0;
Medics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst und wirst Notrufe empfangen.");
JobDuty[playerid] = 1;
Medics += 1;
}
}
else if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst und empfängst keine Notrufe mehr.");
JobDuty[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst und wirst Notrufe empfangen.");
JobDuty[playerid] = 1;
}
}
else if(PlayerInfo[playerid][pJob] == 7)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst als Automechaniker und empfängst keine Anrufe mehr.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst als Automechaniker und wirst Notrufe empfangen..");
JobDuty[playerid] = 1;
Mechanics += 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du kannst nicht in den Dienst gehen !");
}
}
return 1;
} -
jetzt kommt der fehler
(43461) : error 021: symbol already defined: "NameTimer"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase1 Error.
und kannst du mir sagen wo man pawn lernen kann halt daheim nicht in einer hochschule oder so. -
Du hast NameTimer zweimal definiert.
Geh mal in Zeile 43461 und lösch die definition.Und zu zweitens.
Schau dir mal die Tutorials hier an,
lern etwas englisch. und schon kannste es einiger Maßen
War zumindestens bei mir so^^ -
Ok jetzt habe ich den Befehl eingefügt und Complimiert aber jetzt kommt immer noch des gleiche Problem. Warum?
-
Und dein /su befehl??