Hey, habe paar scripting probleme...
1. /heal mit Dialog ( ob man Heal will oder nich )
Codes:
new HPreis[MAX_PLAYERS];
new HMedic[MAX_PLAYERS];
ocmd:heal(playerid,params[],string[256],string2[256])
{
new pID,preis;
if(!isPlayerInFrak(playerid,5))return SendClientMessage(playerid,Rot,"Du bist kein Medic!");
if(sscanf(params,"ud",pID,preis))return SendClientMessage(playerid,Rot,"Benutzung: /heal [Spieler] [Preis]");
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,Rot,"Dieser Spieler ist nicht Online!");
format(string,sizeof(string),"Notarzt %s ~ bietet dir eine Heilung für %d$ an.",SpielerName(playerid),preis);
ShowPlayerDialog(pID,DIALOG_Heal,DIALOG_STYLE_MSGBOX,"Heal",string,"Annehmen","Ablehnen");
HPreis[pID] = preis;
HMedic[pID] = playerid;
return 1;
}
if(dialogid == DIALOG_Heal)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new string[128];
if(response == 0)
{
return 1;
}
else
{
GivePlayerMoney(HMedic[playerid],GetPlayerMoney(HMedic[playerid]) +HPreis[playerid]);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -HPreis[playerid]);
format(string,sizeof(string),"**%s heilt %s.",SpielerName(HMedic[playerid]),playerid);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInRangeOfPoint(i,5,x,y,z))continue;
SendClientMessage(i,Lila,string);
}
SetPlayerHealth(playerid,150);
}
return 1;
}
Der gibt mir dann iwi wenn ich mich heale ca 1 Milliarde oder so...
2. /waffenladen ( waffen kaufen ) [Normal :)]
Codes:
ocmd:waffenladen(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid,10,314.2562,-133.9637,999.6016))return SendClientMessage(playerid,Rot,"Du bist in keinem Waffenladen!");
if(GetPVarInt(playerid,"WaffenSchein") !=1)return SendClientMessage(playerid,Rot,"Du hast kein Waffenschein!");
ShowPlayerDialog(playerid,DIALOG_Waffen,DIALOG_STYLE_LIST,"Waffenladen","Pistolen\nMaschingewehre\nGewehre\nSonstiges","Auswählen","Abbrechen");
return 1;
}
if(dialogid == DIALOG_Waffen)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,DIALOG_Waffen_Pistolen,DIALOG_STYLE_LIST,"Pistolen","9mm 1500$\nSilencer 2000$\nDesert Eagle 3000$","Kaufen","Abbrechen");
return 1;
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,DIALOG_Waffen_Maschingewehre,DIALOG_STYLE_LIST,"Maschingewehre","MP5 3500$\nM4 5000$\nAK47 5000$","Kaufen","Abbrechen");
return 1;
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,DIALOG_Waffen_Gewehre,DIALOG_STYLE_LIST,"Gewehre","Shotgun 2500$\nCountry Rifle 3500$\nSniper Rifle 8500$","Kaufen","Abbrechen");
return 1;
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,DIALOG_Waffen_Sonstiges,DIALOG_STYLE_LIST,"Sonstiges","Messer 500$\nBaseball 500$\nKatana 1500$\nFallschirm 500$","Kaufen","Abbrechen");
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_Waffen_Pistolen)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid,22,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -1500);
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,23,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -2000);
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,24,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -3000);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_Waffen_Maschingewehre)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid,29,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -3500);
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,31,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -5000);
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,30,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -5000);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_Waffen_Gewehre)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid,25,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -2500);
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,33,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -3500);
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,34,200);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -8500);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_Waffen_Sonstiges)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid,4,1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -500);
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,5,1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -500);
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,8,1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -1500);
return 1;
}
if(listitem == 3)
{
GivePlayerWeapon(playerid,46,1);
GivePlayerMoney(playerid,GetPlayerMoney(playerid) -500);
return 1;
}
return 1;
}
return 1;
}
Hier zieht der mir kein Geld ab, sondern gibt mir immer ca. 20k oder so...
Hoffe ihr könnt mir helfen
Danke im Voraus