CMD:shop(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 40, 286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 286.800994,-82.547599,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 314.820983,-141.431991,999.601562) || IsPlayerInRangeOfPoint(playerid, 40, 316.524993,-167.706985,999.593750))
ShowPlayerDialog(playerid, DIALOGWEAPONS, DIALOG_STYLE_LIST, "Hello, need gun ??", "Deagle(15k)\nShotgun(2.5k)\nMP5(2k)\nSpas12(5k)\nAK-47(3k)\nM4(3.5k)\nSniper(1k)\nHalf vest(5k)\nFull vest(2.5k)","Buy","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -5000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Hehe.
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -5000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
}
Replace the Dialogresponse with this:
pawn Код:
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -5000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public ZoneTimer()
{
for(new i=0; i < sizeof(ZoneInfo); i++) // loop all zones
{
if(ZoneAttacker[i] != -1) // zone is being attacked
{
if(GetPlayersInZone(i, ZoneAttacker[i]) >= MIN_MEMBERS_TO_START_WAR) // team has enough members in the zone
{
ZoneAttackTime[i]++;
if(ZoneAttackTime[i] == TAKEOVER_TIME) // zone has been under attack for enough time and attackers take over the zone
{
GangZoneStopFlashForAll(ZoneID[i]);
ZoneInfo[i][zTeam] = ZoneAttacker[i];
GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam])); // update the zone color for new team
ZoneAttacker[i] = -1;
}
}
else // attackers failed to take over the zone
{
GangZoneStopFlashForAll(ZoneID[i]);
ZoneAttacker[i] = -1;
}
}
else // check if somebody is attacking
{
for(new t=0; t < sizeof(Teams); t++) // loop all teams
{
if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
{
ZoneAttacker[i] = Teams[t];
ZoneAttackTime[i] = 0;
GangZoneFlashForAll(ZoneID[i], 0xFF000055);
}
}
return 1;
}
}
}
CMD:cg(playerid, params[])//line 1003
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(959) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(959) : error 004: function "OnPlayerClickPlayer" is not implemented
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : warning 225: unreachable code
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : error 004: function "ZoneTimer" is not implemented
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 017: undefined symbol "cmd_cg"
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : fatal error 107: too many error messages on one line
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(958) : warning 209: function "OnDialogResponse" should return a value
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1000) : warning 209: function "ZoneTimer" should return a value
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1035) : warning 203: symbol is never used: "InDM"
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1035) : warning 203: symbol is never used: "veh2"
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -5000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
return 0;
}