Help Please
#1

I want to add a send client message if the player is not in the vehicle what can i add

PHP код:
CMD:removerplayerv(playeridparams[])
{
    new 
targetid;
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_DARKRED,"[ERRO:] You are not admin!");
    if(
sscanf(params,"u"targetid)) return SendClientMessage(playeridCOLOR_ADMINCMD,"[INFO:] /removerplayerv [PlayerID]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_NICERED,"[ERROR:] Player is not connected!");
    if(!
IsInVehicle(targetid)) return SendClientMessage(playeridCOLOR_NICERED,"[ERROR:] The player is not in vehicle!");
    
RemovePlayerFromVehicle(targetid);
    return 
1;

Error:
PHP код:
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(201) : error 017undefined symbol "IsInVehicle"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

Line:
Reply
#2

It's IsPlayerInAnyVehicle(targetid) not IsInVehicle.

Read more about it here.
Reply
#3

i changed for that

PHP код:
CMD:removerplayerv(playeridparams[])
{
    new 
targetid;
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_DARKRED,"[ERRO:] Nгo йs administrador!");
    if(
sscanf(params,"u"targetid)) return SendClientMessage(playeridCOLOR_ADMINCMD,"[INFO:] /removerplayerv [PlayerID]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_NICERED,"[ERRO:] O jogador nao estб conectado!");
    if(!
IsPlayerInVehicle(targetid)) return SendClientMessage(playeridCOLOR_NICERED,"[ERRO:] O player nao estб em nenhum veiculo!");
    
RemovePlayerFromVehicle(targetid);
    return 
1;

but

PHP код:
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(201) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Warning

Line 201

PHP код:
    if(!IsPlayerInVehicle(targetid)) return SendClientMessage(playeridCOLOR_NICERED,"[ERRO:] O player nao estб em nenhum veiculo!"); 
Reply
#4

work thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)