Little code Help
#1

I need some help in that code:

Код:
if(strcmp("/buyskin", cmd, true) == 0)
	{
		new playername[128];
        GetPlayerName(playerid, playername, sizeof(playername));
		new tmp[256];
		tmp = strtok(cmdtext, idx);
        if(!PlayerToPoint(playerid,161.4829,-83.2534,1001.8047,5)) return SendClientMessage(playerid, COLOR_WARNING, "You must be at the ZIP shop to buy a skin!");
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WARNING, "Correct usage: /buysin <skin id>");
        new skinid = strval(tmp);
        if(Skinlist[playerid][Skin]==-1)
		{
            	if(skinid < 0 || skinid > 299) return SendClientMessage(playerid, COLOR_WARNING, "Please choose a skin from ID:0 to ID:299!");
				if(ZIP[skinid][Status]==0)
				{
					new price = 750;
					if (GetPlayerMoney(playerid) >= price)
 					{
						GivePlayerMoney(playerid, -price);
						Skinlist[playerid][Skin]=skinid;
						ZIP[skinid][Status]=1;
 						ZIP[skinid][Owner]=playername;
						format(string,128,"Congratulations! You purchased skin ID: %i for $%i!", skinid, price);
						SendClientMessage(playerid, COLOR_GREEN, string);
						return 1;
					}
					else
					{
						format(string, 128, "You don't have enough money! Costs: $%i", price);
						SendClientMessage(playerid, COLOR_WARNING, string);
						return 1;
					}
				}
				else
				{
                    format(string,128,"This skin is already bought by %s!", ZIP[skinid][Owner]);
					SendClientMessage(playerid, COLOR_WARNING, string);
                    return 1;
				}
		}
		else
		{
            SendClientMessage(playerid, COLOR_WARNING, "You are already owning a skin!");
			return 1;
		}
	}
	if(strcmp("/sellskin", cmdtext, true) == 0)
	{
	    if (Skinlist[playerid][Skin]!=-1)
	    {
            if(PlayerToPoint(playerid,161.4521,-92.1347,1001.8047,10))
			{
                    if(Unwearedskin[playerid])
					{
					new skinid = Skinlist[playerid][Skin];
	        		new price = 50;
	        		GivePlayerMoney(playerid, price);
					format(string,128,"You sold successfully you skin ID: %i for $%i!", Skinlist[playerid][Skin], price);
					SendClientMessage(playerid, COLOR_GREEN, string);
                    ZIP[skinid][Status]=0;
					format(ZIP[skinid][Owner], 128, "Zip Shop");
                    Skinlist[playerid][Skin]=-1;
					return 1;
			}
			else
			{
   			SendClientMessage(playerid, COLOR_WARNING, "You must unwear your skin before you sell it!");
			return 1;
			}
	    }
	    else
		{
			SendClientMessage(playerid, COLOR_WARNING, "You must be at the ZIP shop to sell your skin!");
   			SendClientMessage(playerid, COLOR_GREY, "HINT: Type /zip to see the location of the ZIP shop!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_WARNING, "You don't have any skin  bought to sell one!");
			return 1;
			}
}
	return 0;
}
I want to change that "if (GetPlayerMoney(playerid) >= price)" to "if (GetPlayerPCash(playerid) >= price)" but its giving errors:
Код:
C:\DOCUME~1\malik\Desktop\UMARTH~1\stupit\UMARAM~1\sum\FILTER~1\_FS__S~1.PWN(305) : error 017: undefined symbol "GetPlayerPCash"
C:\DOCUME~1\malik\Desktop\UMARTH~1\stupit\UMARAM~1\sum\FILTER~1\_FS__S~1.PWN(373) : warning 203: symbol is never used: "PCash"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Can Any one help me with that??
Reply
#2

It's not an error, it's a warning that tells you the symbol "PCash" is not used, this means you have declared somewhere PCash but you never used it.
Reply
#3

Sorry My bad..


Fixed!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)