#include <a_samp>
#define weapons 4670
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Weapon Spawner by FusiouS loaded ");
print(" Version: 1.0, Release 1");
print("--------------------------------------");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/arme", true))
{
ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Arme", "Cutit-500$\nBata de Baseball-100$\nDeagle-1000$\nShotgun-1500$\nShotgun de Lupta-2000$\nTec-9-1500$\nMP5-1500$\nAK-47-2500$\nSniper(Luneta)-3000$\nLansator(Agheu)-4000$\nGrenade-5000$\nCocktail Molotov-4000$\nM4A1-3000$", "Alege", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weapons)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 4, 1);
GivePlayerMoney(playerid,-500);
}
case 1:
{
GivePlayerWeapon(playerid, 5, 1);
GivePlayerMoney(playerid,-100);
}
case 2:
{
GivePlayerWeapon(playerid, 24, 300);
GivePlayerMoney(playerid,-1000);
}
case 3:
{
GivePlayerWeapon(playerid, 25, 500);
GivePlayerMoney(playerid,-1500);
}
case 4:
{
GivePlayerWeapon(playerid, 27, 500);
GivePlayerMoney(playerid,-2000);
}
case 5:
{
GivePlayerWeapon(playerid, 32, 500);
GivePlayerMoney(playerid,-1500);
}
case 6:
{
GivePlayerWeapon(playerid, 29, 500);
GivePlayerMoney(playerid,-1500);
}
case 7:
{
GivePlayerWeapon(playerid, 30, 500);
GivePlayerMoney(playerid,-2500);
}
case 8:
{
GivePlayerWeapon(playerid, 34, 500);
GivePlayerMoney(playerid,-3000);
}
case 9:
{
GivePlayerWeapon(playerid, 36, 500);
GivePlayerMoney(playerid,-4000);
}
case 10:
{
GivePlayerWeapon(playerid, 16, 500);
GivePlayerMoney(playerid,-5000);
}
case 11:
{
GivePlayerWeapon(playerid, 18, 500);
GivePlayerMoney(playerid,-4000);
}
case 12:
{
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid,-3000);
}
}
}
return 1;
}
#include <a_samp>
#define weapons 4670
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Weapon Spawner by FusiouS loaded ");
print(" Version: 1.0, Release 1");
print("--------------------------------------");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/arme", true))
{
ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Arme", "Cutit-500$\nBata de Baseball-100$\nDeagle-1000$\nShotgun-1500$\nShotgun de Lupta-2000$\nTec-9-1500$\nMP5-1500$\nAK-47-2500$\nSniper(Luneta)-3000$\nLansator(Agheu)-4000$\nGrenade-5000$\nCocktail Molotov-4000$\nM4A1-3000$", "Alege", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weapons)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 4, 1);
GivePlayerMoney(playerid,-500);
}
case 1:
{
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 5, 1);
GivePlayerMoney(playerid,-100);
}
case 2:
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 24, 300);
GivePlayerMoney(playerid,-1000);
}
case 3:
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 25, 500);
GivePlayerMoney(playerid,-1500);
}
case 4:
{
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 27, 500);
GivePlayerMoney(playerid,-2000);
}
case 5:
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 32, 500);
GivePlayerMoney(playerid,-1500);
}
case 6:
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 29, 500);
GivePlayerMoney(playerid,-1500);
}
case 7:
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 30, 500);
GivePlayerMoney(playerid,-2500);
}
case 8:
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 34, 500);
GivePlayerMoney(playerid,-3000);
}
case 9:
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 36, 500);
GivePlayerMoney(playerid,-4000);
}
case 10:
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 16, 500);
GivePlayerMoney(playerid,-5000);
}
case 11:
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 18, 500);
GivePlayerMoney(playerid,-4000);
}
case 12:
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You have insufficient funds to purchase this weapon.");
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid,-3000);
}
}
}
return 1;
}
GivePlayerMoney(killerid,2000);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
case 0:
{
if(GetPlayerMoney(playerid) > 500) return SendClientMessage(playerid,-1,"Not enough money");
GivePlayerWeapon(playerid, 4, 1);
GivePlayerMoney(playerid,-500);
}
I want when a player kills another player,i want when he do that he get 2.000$ and 1 point [when press tab and see player's scores] |
#include <a_samp>
#define weapons 4670
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Weapon Spawner by FusiouS loaded ");
print(" Version: 1.0, Release 1");
print("--------------------------------------");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/arme", true))
{
ShowPlayerDialog(playerid, weapons, DIALOG_STYLE_LIST, "Arme", "Cutit-500$\nBata de Baseball-100$\nDeagle-1000$\nShotgun-1500$\nShotgun de Lupta-2000$\nTec-9-1500$\nMP5-1500$\nAK-47-2500$\nSniper(Luneta)-3000$\nLansator(Agheu)-4000$\nGrenade-5000$\nCocktail Molotov-4000$\nM4A1-3000$", "Alege", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pCash;
pCash = GetPlayerMoney(playerid);
if(dialogid == weapons)
{
switch(listitem)
{
case 0:
{
if(pCash < 500) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 4, 1);
GivePlayerMoney(playerid,-500);
}
case 1:
{
if(pCash < 100) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 5, 1);
GivePlayerMoney(playerid,-100);
}
case 2:
{
if(pCash < 1000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 24, 300);
GivePlayerMoney(playerid,-1000);
}
case 3:
{
if(pCash < -1500) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 25, 500);
GivePlayerMoney(playerid,-1500);
}
case 4:
{
if(pCash < 2000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 27, 500);
GivePlayerMoney(playerid,-2000);
}
case 5:
{
if(pCash < 1500) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 32, 500);
GivePlayerMoney(playerid,-1500);
}
case 6:
{
if(pCash < 1500) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 29, 500);
GivePlayerMoney(playerid,-1500);
}
case 7:
{
if(pCash < 2500) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 30, 500);
GivePlayerMoney(playerid,-2500);
}
case 8:
{
if(pCash < 3000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 34, 500);
GivePlayerMoney(playerid,-3000);
}
case 9:
{
if(pCash < 4000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 36, 500);
GivePlayerMoney(playerid,-4000);
}
case 10:
{
if(pCash < 5000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 16, 500);
GivePlayerMoney(playerid,-5000);
}
case 11:
{
if(pCash < 4000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 18, 500);
GivePlayerMoney(playerid,-4000);
}
case 12:
{
if(pCash < 3000) return SendClientMessage(playerid, -1, "You don't have enough money.");
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid,-3000);
}
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); // +1 score
GivePlayerMoney(killerid, 2000); // cahs 2000
}
return 1;
}
if (strcmp("/armour", cmdtext, true, 10) == 0)
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Nu ai destui bani pentru a cumpara armura.");
GivePlayerMoney(playerid,-1000);
SetPlayerArmour(playerid,100);
return 1;
}
Everything works perfectly but,how can i save all players points,because when i restart the server they lose all they're points...
|
if(!strcmp("/armour", cmdtext))
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Nu ai destui bani pentru a cumpara armura.");
GivePlayerMoney(playerid,-1000);
SetPlayerArmour(playerid,100);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0; // this return 0
}