15.05.2010, 13:35
Hey, another day another problem :P
ehm now i have a problem with the swith-command:
i posted a topic before called "trouble with ammo-array" and i've still problems with that too. (i changed my method to zcmd since last topic.)
BTW so i just want to decide which weapon was chosen and give the player the weapon. there is only the desert eagle yet.
ehm now i have a problem with the swith-command:
Код:
zcmd(kaufe, playerid, params[])
{
new pWaffe;
if (!sscanf(params, "s", pWaffe))
{
switch (pWaffe)
{
case pWaffe = "deagle":
{
gAmmo[playerid] + 20;
GivePlayerMoney(playerid, -300);
SendClientMessage(playerid, GREEN, "Du hast dir eine Desert Eagle gekauft");
GivePlayerWeapon(playerid, 24, gAmmo[playerid]);
return 1;
}
default:
{
SendClientMessage(playerid, RED, "Die Waffe existiert nicht.");
return 1;
}
}
}
else if (GetPlayerMoney(playerid) < 300)
{
SendClientMessage(playerid, RED, "Du hast nicht genug Geld.");
}
else
{
SendClientMessage(playerid, RED, "Anwendung: /kaufe deagle");
}
return 1;
}
BTW so i just want to decide which weapon was chosen and give the player the weapon. there is only the desert eagle yet.

