No I don't know "deathrun shops" since I haven't played on those servers. But I can help with points.
You can create a array of players for which will hold all players points like this.
We assume that this are our 32 players
PHP Code:
new deathrun_points[32] = 0;
And this is our function to call when a player clicks on it.
myMenuItem(id, item) - Where id is a player identificator and item is an integer.
case 1: - Is a grenade that costs 500$.
PHP Code:
public myMenuItem(id, item) {
new user_money = cs_get_user_money(id);
switch(item) {
case 1: {
if(user_money >= 500) {
// bla bla, give player a grenade.
// this removes 500 from their money.
cs_set_user_money(id, user_money - 500);
}
}
// more other cool items.
}
}
}
We want to perfom a check if player have any points, so now we modify this function a bit so it looks like this.
PHP Code:
public myMenuItem(id, item) {
new user_money = cs_get_user_money(id);
switch(item) {
case 1: {
if(user_money >= 500) {
// bla bla, give play grenade.
// this removes 500 from their money.
cs_set_user_money(id, user_money - 500);
} else if(deathrun_points[id] >= 2) {
// this removes 2 points from player.
deathrun_points[id] = deathrun_points[id] - 2;
} else {
client_cmd(1,print_chat,"Man, no money or points. Sorry, no grenade for you.");
}
}
// more other cool items.
}
}
}
CODE FIX: If you look closely, I have modified the if statement and added an else check.
And our final code will be this.
PHP Code:
new deathrun_points[32] = 0;
public myMenuItem(id, item) {
new user_money = cs_get_user_money(id);
switch(item) {
case 1: {
if(user_money >= 500) {
// bla bla, give play grenade.
// this removes 500 from their money.
cs_set_user_money(id, user_money - 500);
} else if(deathrun_points[id] >= 2) {
// this removes 2 points from player.
deathrun_points[id] = deathrun_points[id] - 2;
} else {
client_cmd(1,print_chat,"Man, no money or points. Sorry, no grenade for you.");
}
}
// more other cool items.
}
}
Have you understood anything of this?