trying to upgrade the armor command buit it doesnt work
#1

i'm a noobie in scripting so

if the player is using the command /armour then her get 100 armor
but if the player already have 100 armor he can't use that command


i got something like this


PHP код:
#include <a_samp>
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00FF00FF
new Float:armour;
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/armour"cmdtexttrue10) == 0)
    {
        
#if(playerid,armour, 100);
        
GetPlayerArmour(playeridarmour);
        
SendClientMessage(playerid,COLOR_RED,"you already have an armour");
        
#else
        
SetPlayerArmour(playerid100);
        
SendClientMessage(playerid,COLOR_RED"you have buyed bulletproof vest");
        
GivePlayerMoney(playerid, -200);
        
#endif
        
return 1;
        }
    return 
0;

Reply
#2

Код:
#include <a_samp>
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00FF00FF

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/armour", cmdtext, true, 10) == 0)
    {
        new Float: armour;
        GetPlayerArmour(playerid, armour);
        if(armour < 100)
        {
	        SetPlayerArmour(playerid, 100);
	        GivePlayerMoney(playerid, -200);
	        SendClientMessage(playerid,COLOR_RED, "You have bought a bulletproof vest");
	        return 1;
        }
	else return SendClientMessage(playerid, COLOR_RED, "You already have full armour");
    }
    return 0;
}
Reply
#3

thnx
Reply
#4

Nope...


Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
    {
     new Float: Armour;
     GetPlayerArmour(playerid, Armour);
     if(Armour < 100) {
      if(GetPlayerMoney(playerid) >= 200) {
	        SetPlayerArmour(playerid, 100);
	        GivePlayerMoney(playerid, -200);
	        SendClientMessage(playerid,-1, "Your armour is now Full! xD");
	        return 1;
      } else return SendClientMessage(playerid, -1," You need more money ,dude...");
     } else return SendClientMessage(playerid, -1 , " Your armour is alerty full");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)