Problem. Need Help!
#1

Код HTML:
	if(strcmp(cmdtext, "/veh", true) == 0) {
    {
        new CreatedCars[100];
        new CreatedCar;
        new idx;
		new tmp[128];
		new cmd[256];
		cmd = strtok(cmdtext, idx);
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "Gamoyeneba: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, 0x4B00B0AA, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            format(string, sizeof(string), "   Vehicle %d spawned.", carid);
            SendClientMessage(playerid, 0x4B00B0AA, string);
        }
		return 1;
	}
	return 0;
}
i have this code in my server and when i save project, pawno says warnings:

Код HTML:
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(220) : warning 204: symbol is assigned a value that is never used: "string"
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(387) : error 017: undefined symbol "string"
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(387) : error 017: undefined symbol "string"
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(387) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(387) : fatal error 107: too many error messages on one line

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


4 Errors.
Please Help Me!
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/veh", true) == 0) {
    {
        new string[128];
        new CreatedCars[100];
        new CreatedCar;
        new idx;
        new tmp[128];
        new cmd[256];
        cmd = strtok(cmdtext, idx);
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "Gamoyeneba: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, 0x4B00B0AA, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            format(string, sizeof(string), "   Vehicle %d spawned.", carid);
            SendClientMessage(playerid, 0x4B00B0AA, string);
        }
        return 1;
    }
    return 0;
}
Reply
#3

Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/veh", true) == 0) {
    {
        new string[128];
        new CreatedCars[100];
        new CreatedCar;
        new idx;
        new tmp[128];
        new cmd[256];
        cmd = strtok(cmdtext, idx);
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "Gamoyeneba: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, 0x4B00B0AA, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            format(string, sizeof(string), "   Vehicle %d spawned.", carid);
            SendClientMessage(playerid, 0x4B00B0AA, string);
        }
        return 1;
    }
    return 0;
}
now is many errors:
Код HTML:
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(392) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(394) : warning 217: loose indentation
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(394) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(394) : error 004: function "S@@_OnPlayerEnterVehicle" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(399) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(399) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(399) : error 004: function "S@@_OnPlayerExitVehicle" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(404) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(404) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(404) : error 004: function "S@@_OnPlayerStateChange" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(409) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(409) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(409) : error 004: function "S@@_OnPlayerEnterCheckpoint" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(414) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(414) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(414) : error 004: function "S@@_OnPlayerLeaveCheckpoint" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(419) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(419) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(419) : error 004: function "S@@_OnPlayerEnterRaceCheckpoint" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(424) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(424) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(424) : error 004: function "S@@_OnPlayerLeaveRaceCheckpoint" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(429) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(429) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(429) : error 004: function "S@@_OnRconCommand" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(434) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(434) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(434) : error 004: function "S@@_OnPlayerRequestSpawn" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(439) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(439) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(439) : error 004: function "S@@_OnObjectMoved" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(444) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(444) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(444) : error 004: function "S@@_OnPlayerObjectMoved" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(449) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(449) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(449) : error 004: function "S@@_OnPlayerPickUpPickup" is not implemented
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(454) : warning 225: unreachable code
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(454) : error 029: invalid expression, assumed zero
D:\Files\Programs\BIG CITY LIFE\gamemodes\BCL.pwn(454) : error 004: function "S@@_OnVehicleMod" is not implemented

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


26 Errors.
Reply
#4

Press Ctrl + G and type 220, and delete the following
pawn Код:
new string[/* value here */];
// It may be 128;
Also, you have double {{.
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if(strcmp(cmdtext, "/veh", true) == 0)
    {
        new CreatedCars[100];
        new CreatedCar;
        new idx;
        new tmp[128];
        new cmd[256];
        cmd = strtok(cmdtext, idx);
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "Gamoyeneba: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, 0x4B00B0AA, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, 0x4B00B0AA, "   Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            new string[64]; // <--
            format(string, sizeof(string), "   Vehicle %d spawned.", carid);
            SendClientMessage(playerid, 0x4B00B0AA, string);
        }
        return 1;
    }
    return 0;
}
Reply
#5

Thanks! ♥
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)