How to fine -500$?
#1

I made a npc bot taxi around los santos with cmd /taxiroute in which I define my taxi's route.. Can anyone tell me codes that will find player 500$ when he/she enters in npc vehicle by pressing G?
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER && /*check if it's that taxi*/)
    {
        if(GetPlayerMoney(playerid) >= 500)
            GivePlayerMoney(playerid, -500);
    }
}
Reply
#3

My bot name is ron, so please give me all codes with my ron's car

My bot name : Ron
Bot's car name : Ron
Recording file: Ron.rec
Recorded amx: Ron.amx please tell me in more details
Reply
#4

Have a variable:
pawn Код:
new RonsTaxi;
Make a static vehicle under RonsTaxi:
pawn Код:
RonsTaxi = AddStaticVehicleEx(....);
Use what SEnergy said and check the vehicleid:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER && GetPlayerVehicleID(playerid) == RonsTaxi)
    {
        if(GetPlayerMoney(playerid) >= 500)
            GivePlayerMoney(playerid, -500);
    }
}
Reply
#5

D:\npcss\filter\npc.pwn(246) : error 017: undefined symbol "newstate"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Quote:
Originally Posted by SampLoverNo123
Посмотреть сообщение
D:\npcss\filter\npc.pwn(246) : error 017: undefined symbol "newstate"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Are you sure that is under OnPlayerStateChange and not for example under OnPlayerKeyStateChange?
Reply
#7

Fixed
Reply
#8

post me your code
Reply
#9

Why? Do you have same problem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)