Commands [Error]
#1

I get error when i compile these two commands.
Please help

Код:
CMD:giveweapon(playerid, params[])
{
    if(APlayerData[playerid][PlayerLevel] >=2)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low Level.");

    new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2)) return SendUsage(playerid, "/giveweapon [playerid] [weapon id/weapon name] [ammo]");
    new player1 = strval(tmp), weap, ammo, WeapName[32];
    if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
    if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2); else weap = strval(tmp2);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
    {
        if(!IsValidWeapon(weap)) return SendError( playerid, "Invalid weapon ID");

        GetWeaponName(weap,WeapName,32);
        GivePlayerWeapon(player1, weap, ammo);
        if(player1 == playerid)
        {
            FormMessageForAllEx(playerid,COLOR_RED, "Administrator %s gave himself a %s (ID:%d) with %d rounds of ammo!",PlayerName2( playerid ),WeapName, weap, ammo);
            FormMessage( playerid, COLOR_GREEN, "You gave yourself a %s (ID: %d) with %d rounds of ammo!", WeapName, weap, ammo);
        }
        else
        {
            FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s gave %s's a %s (ID:%d) with %d rounds of ammo!",PlayerName2( playerid ), PlayerName2( player1 ),WeapName, weap, ammo);
            FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s gave you a %s (ID: %d) with %d rounds of ammo!",PlayerName2( playerid ), WeapName, weap, ammo);
            FormMessage( playerid, COLOR_GREEN, "You gave %s a %s (ID: %d) with %d rounds of ammo!",PlayerName2( player1 ),WeapName, weap, ammo );
        }
    } else return SendError( playerid, "Player is not connected");
and

Код:
CMD:givevehicle(playerid, params[])
{
    if(APlayerData[playerid][PlayerLevel] >=2)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low level!");
    if ( sscanf( params, "u", params[ 0 ] ) )return SendUsage( playerid, "/givecar <id>" );
    if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
    if( params[ 0 ] == playerid )return SendError( playerid, "If you want to give yourself a car use /car");

    new Float:X, Float:Y, Float:Z, Float:A,vGiveCar;

    GetPlayerPos( params[ 0 ], X , Y , Z );
    GetPlayerFacingAngle( params[0 ], A);

    vGiveCar = CreateVehicle(415, X, Y, Z, A, random(  126 ), random( 126 ), 500000 ),LinkVehicleToInterior( vGiveCar , GetPlayerInterior( params[ 0 ]) );
    FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s gave you a car!",PlayerName2( playerid ));
    return 1;
}
Reply
#2

Which errors you get?
Reply
#3

Код:
C:\Users\linda\Documents\GT Testing\pawno\include\GameModeInit.inc(183) : warning 213: tag mismatch
C:\Users\linda\Documents\GT Testing\pawno\include\GameModeInit.inc(183) : warning 202: number of arguments does not match definition
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(7) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(8) : error 017: undefined symbol "SendUsage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(9) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(10) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(18) : error 017: undefined symbol "FormMessage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(23) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(26) : error 017: undefined symbol "SendUsage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(28) : error 017: undefined symbol "IsNumeric"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(29) : error 017: undefined symbol "IsNumeric"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(29) : error 017: undefined symbol "GetWeaponIDFromName"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(32) : error 017: undefined symbol "IsValidWeapon"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(32) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(38) : error 017: undefined symbol "FormMessageForAllEx"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(39) : error 017: undefined symbol "FormMessage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(43) : error 017: undefined symbol "FormMessageForAllEx"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(44) : error 017: undefined symbol "FormMessage"
Reply
#4

Can you wait me 5 mins till i get pc..?
Reply
#5

Yeah sure.
Reply
#6

Add on giveweapon..

pawn Код:
new SendError[128]
new SendUsage[128]
also add it on givevehicle...


Add that and tell me the errors after it.
Reply
#7

Код:
C:\Users\linda\Documents\GT Testing\pawno\include\GameModeInit.inc(183) : warning 213: tag mismatch
C:\Users\linda\Documents\GT Testing\pawno\include\GameModeInit.inc(183) : warning 202: number of arguments does not match definition
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(7) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(8) : error 017: undefined symbol "SendUsage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(9) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(10) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(18) : error 017: undefined symbol "FormMessage"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(23) : error 017: undefined symbol "SendError"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(23) : error 079: inconsistent return types (array & non-array)
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(24) : warning 219: local variable "SendError" shadows a variable at a preceding level
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(25) : error 001: expected token: ";", but found "new"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(25) : warning 219: local variable "SendUsage" shadows a variable at a preceding level
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(26) : error 001: expected token: ";", but found "new"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : error 012: invalid function call, not a valid address
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : warning 215: expression has no effect
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : warning 215: expression has no effect
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : error 001: expected token: ";", but found ")"
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : error 029: invalid expression, assumed zero
C:\Users\linda\Documents\GT Testing\pawno\include\PlayerCommands.inc(27) : fatal error 107: too many error messages on one line

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


13 Errors.
Reply
#8

Check ur pms...
Reply
#9

Ok....
Reply
#10

Still not solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)