Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) (
/showthread.php?tid=581340)
Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) -
SpikY_ - 12.07.2015
Hellu,
I'm little bit confused with these codes. take a look here:
PHP код:
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);
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(510, pos[0],pos[1],pos[2],pos[3], -1,-1, 10);
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.
Re: Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) -
M0HAMMAD - 12.07.2015
you don't close
} for if(IsPlayerInAnyVehicle(playerid) !
Re: Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) -
M0HAMMAD - 12.07.2015
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 !
Re: Problem with if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) -
SpikY_ - 12.07.2015
ah thanks fixed.!