Sricpt problem here.
#1

Error i get

Код:
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerKeyStateChange.pwn(79) : error 017: undefined symbol "newstate"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerKeyStateChange.pwn(81) : warning 204: symbol is assigned a value that is never used: "newcar"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerKeyStateChange.pwn(81 -- 83) : error 017: undefined symbol "newcar"
Code
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new newcar = GetPlayerVehicleID(playerid);
    }
    if(IsATaxicar(newcar))
    {
        if(PlayerInfo[playerid][pJob] == 2)
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
        return 1;
Reply
#2

Well, make sure you have it under OnPlayerStateChange, not OnPlayerKeyStateChange.
Reply
#3

pawn Код:
if(newstate == 2)
    {
        if(GetPlayerVehicleID(playerid) == IsATaxicar)
        {
        if(PlayerInfo[playerid][pJob] != 2)
        {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
        }
//...
Reply
#4

Do you use them in OnPlayerStateChange Callback?
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Do you use them in OnPlayerStateChange Callback?
Now i use it.

i get this how to fix it

Код:
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(109) : warning 204: symbol is assigned a value that is never used: "newcar"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(109 -- 111) : error 017: undefined symbol "newcar"
Reply
#6

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    new newcar;
    {
        newcar = GetPlayerVehicleID(playerid);
    }
    if(IsATaxicar(newcar))
    {
        if(PlayerInfo[playerid][pJob] == 2)
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
        return 1;
Reply
#7

Quote:
Originally Posted by CmZxC
Посмотреть сообщение
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    new newcar;
    {
        newcar = GetPlayerVehicleID(playerid);
    }
    if(IsATaxicar(newcar))
    {
        if(PlayerInfo[playerid][pJob] == 2)
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
        return 1;
Then i get this

pawn Код:
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(108) : error 017: undefined symbol "newcar"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(108) : warning 215: expression has no effect
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(110) : error 017: undefined symbol "newcar"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(112) : error 017: undefined symbol "newcar"
Reply
#8

I would use:
pawn Код:
new newcar = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
       if(IsATaxicar(newcar))
       {
          if(PlayerInfo[playerid][pJob] == 2) {
           RemovePlayerFromVehicle(playerid);
           SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
           return 1;
            }
       }
       // .. .. other code
    }
    // other checks
Reply
#9

The problem was the bracket. You closed the bracket and inside there is the variable.
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
    new newcar = GetPlayerVehicleID(playerid);

    if(IsATaxicar(newcar))
    {
        if(PlayerInfo[playerid][pJob] == 2) RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
        return 1;
// Rest
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)