[Help] Ammunation Problem
#1

Hi guys im trying to make my own gun store and I got it to work so far, except the part where the person actually types for example:
/buygun deagle
Also when I compile I get these 4 errors:
Код:
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : warning 211: possibly unintended assignment
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : error 046: unknown array size (variable "cmdtext")
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : warning 215: expression has no effect
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : error 001: expected token: ";", but found ")"
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : error 029: invalid expression, assumed zero
C:\Users\SoSu\Desktop\SAMP Server\gamemodes\roleplaytraining.pwn(331) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
I am making my own gamemode in case anyone wants to know which gamemode I am using to help me out.


The Command I Put:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buygun", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,1,308.0848,-141.4177,999.6016))
{
SendClientMessage(playerid, COLOR_BLUE, "------Ammunation------");
SendClientMessage(playerid, COLOR_WHITE, "Deagle - $2500");
SendClientMessage(playerid, COLOR_WHITE, "Shotgun - $1500");
SendClientMessage(playerid, COLOR_WHITE, "Colt45 - $1000");
SendClientMessage(playerid, COLOR_BLUE, "--Legalized Gun Shop--");
{
if(cmdtext = "Deagle")
{
GetPlayerMoney(playerid);
GivePlayerMoney(playerid,-2500);
GivePlayerWeapon(playerid, 24, 10);
{
else if(cmdtext = "Shotgun")
{
GetPlayerMoney(playerid);
GivePlayerMoney(playerid,-1500);
GivePlayerWeapon(playerid, 25, 15);
{
else if(cmdtext = "Colt45")
{
GetPlayerMoney(playerid);
GivePlayerMoney(playerid,-1000);
GivePlayerWeapon(playerid, 22, 50);
}
}
}
}
return 1;
}
Reply
#2

LOL alot of {{{{{{ hehe


pawn Код:
if(strcmp("/buygun", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,5.0,308.0848,-141.4177,999.6016))
        {
             SendClientMessage(playerid, BLUE, "------Ammunation------");
             SendClientMessage(playerid, WHITE, "Deagle - $2500");
             SendClientMessage(playerid, WHITE, "Shotgun - $1500");
             SendClientMessage(playerid, WHITE, "Colt45 - $1000");
             SendClientMessage(playerid, BLUE, "--Legalized Gun Shop--");
        }
        new idx;
        new cmd[128];
        cmd = strtok(cmdtext, idx);
        if(strcmp(cmd,"Deagle"))
        {
            GetPlayerMoney(playerid);
            GivePlayerMoney(playerid,-2500);
            GivePlayerWeapon(playerid, 24, 10);
        }
        else if(strcmp(cmd,"Shotgun"))
        {
            GetPlayerMoney(playerid);
            GivePlayerMoney(playerid,-1500);
            GivePlayerWeapon(playerid, 25, 15);
        }
        else if(strcmp(cmd,"Colt45"))
        {
            GetPlayerMoney(playerid);
            GivePlayerMoney(playerid,-1000);
            GivePlayerWeapon(playerid, 22, 50);
        }
    }
oops bad command it buy u a gun not let you select Haa got robbed 2500 for a deagle.. Hold on ill fixer her up right..
Reply
#3

Still got some errors :P anyone know why I am getting them please help someone! thanks
Reply
#4

Bump, if anyone can help please post here thanks ^-^!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)