Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
#1

Hellu,
I'm little bit confused with these codes. take a look here:

PHP код:
           if (strcmp("/re"cmdtexttrue10) == 0)
            {
            if(
IsPlayerInAnyVehicle(playerid))
            {
            
RepairVehicle(GetPlayerVehicleID(playerid));
            
SendClientMessage(playerid,0xFF0000FF,"{55FF00}» Success: {FFFFFF}Your Vehicle have been Successfully Fixed.!");
            
PlayerPlaySound(playerid10850.00.00.0);
            else
            {
            if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
               new 
Float:pos[4]; [B]/////536 line[/B]
            
GetPlayerPos(id,pos[0],pos[1],pos[2]);
            
GetPlayerFacingAngle(id,pos[3]);
            new 
re CreateVehicle(510pos[0],pos[1],pos[2],pos[3], -1,-110);
            
PutPlayerInVehicle(playerid,re,0);
                    return 
1;
            } 
Errors :

Код:
(533) : error 029: invalid expression, assumed zero
(536) : error 003: declaration of a local variable must appear in a compound block
(536):warning 221: label name "Float" shadows tag name
(536):error 017: undefined symbol "pos"
(536):warning 215: expression has no effect
(536):error 001: expected token: ";", but found "]"
(536):fatal error 107: too many error messages on one line

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


5 Errors.
Reply
#2

you don't close } for if(IsPlayerInAnyVehicle(playerid) !
Reply
#3

Here You Go
pawn Код:
if (strcmp("/re", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid,0xFF0000FF,"{55FF00}» Success: {FFFFFF}Your Vehicle have been Successfully Fixed.!");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }// Forgot This !
        else
        {
            //if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) You Don't need this
            new Float:pos[4]; [B]/////536 line[/B]
            GetPlayerPos(id,pos[0],pos[1],pos[2]);
            GetPlayerFacingAngle(id,pos[3]);
            new re = CreateVehicle(510, pos[0],pos[1],pos[2],pos[3], -1,-1, 10);
            PutPlayerInVehicle(playerid,re,0);
            return 1;
        }
    }// You Don't put this !
Reply
#4

ah thanks fixed.!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)