/service und /accept problem -
Timoleini - 22.06.2012
Hey together,
I have a litte problem. In my eyes it looks like a big problem.
I want to make a service dialog. In there user can call the Cops etc.
So now i have the problem that my code not 100% works.
If anyone call the police , and a police officer typing /accept dialog it will shows
him the player who calls the police ,but if the cop now accept it.
My script will set the checkpoint to the cop , not to the player.. :/ But if the cop call the police to
and accept now another call is all right.
Here is my service Dialog
Код:
if(listitem == 0)
{
if(Polizei[playerid]==0)
{
if(Anfrage[playerid]==0)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
SendClientMessage(playerid,NORMAL,"Ihr Notruf ist bei der Polizei eingangen! Sie wird in kьrze bearbeitet! /cancelcop zum Abbrechen!");
Polizei[playerid] = 1;
Anfrage[playerid] = 1;
ppID[playerid] = giveplayerid;
format(string,sizeof(string),"%s hat die Polizei angefordert! Tippe /accept polizei um die Anfrage anzunehmen",SpielerName(playerid));
PolizeiNachricht(DUNKELPINK,string);
return 1;
}
else SendClientMessage(playerid,NORMAL,"Du hast bereits einen anderen Service angefordert!");
return 1;
}
else SendClientMessage(playerid,NORMAL,"Du hast bereits das Krankenhaus angefordert.Bitte Warte bis deine Anfrage entgegengenommen wird!");
return 1;
}
Here is the Command /accept polizei
Код:
if(strcmp("/accept polizei", cmdtext, true, 10) ==0)
{
if(GetPVarInt(playerid,"Fraktion")==1)
{
if(GetPVarInt(playerid,"copduty")==1)
{
new Aktiv =0,string[128];
for(new i=0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(Polizei[i] == 1)
{
format(string,128,"%s\n%s",string,SpielerName(i));
Aktiv++;
}
}
}
if(Aktiv == 0) return SendClientMessage(playerid,ROT,"Die Polizei wird derzeit nicht benцtigt!");
ShowPlayerDialog(playerid,DIALOG_POLIZEI,DIALOG_STYLE_LIST,"Notrufe",string,"Annehmen","Beenden");
return 1;
}
else SendClientMessage(playerid,NORMAL,"Du bist nicht im Dienst!");
return 1;
}
return 1;
}
And now the Dialog
Код:
if(dialogid==DIALOG_POLIZEI)
{
if(response==0) { return 1; }
if(response==1)
{
new pID = strval(inputtext[50]),string[128],Float:x,Float:y,Float:z;
GetPlayerPos(pID,x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,3);
format(string,sizeof(string),"%s hat deine Anfrage entgegengenommen! Er wird gleich bei dir eintreffen!",SpielerName(playerid));
SendClientMessage(pID,BLAU,string);
format(string,sizeof(string),"Du hast die Anfrage von %s angenommen! Er wurde auf der Karte makiert!",SpielerName(pID));
SendClientMessage(playerid,BLAU,string);
Polizei[pID]= 0;
Anfrage[pID]= 0;
return 1;
}
}
I hope anyone can help me with my problem
// I cant help me .. .(
lg