SA-MP Forums Archive
What is wrong? - 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: What is wrong? (/showthread.php?tid=577610)



What is wrong? - Sn4ke2 - 12.06.2015

I make the command:
PHP код:
CMD:work(playerid,params[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"Trebuie sa te loghezi mai intai.");
    
    if(
PlayerInfo[playerid][pJob] != 14) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Trucker.");
    if(!
IsPlayerInRangeOfPoint(playerid10.0, -146.3690,-1116.3546,4.2725)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get products.");
    new 
Trucker CreateVehicle(515,-142.5756,-1116.7383,5.3989,257.1702,3,77,-1); // Trucker si remorca
    
new TrailerID CreateVehicle(450,-152.0133,-1114.9786,5.9868,258.3351,3,77,-1); // Trucker si remorca
    
AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid));
    
PutPlayerInVehicle(playerid,Trucker,0);
    
SetPlayerCheckpoint(playerid,-96.4776,-1159.1644,2.0905,4.0);
    
IsTruckerStart[playerid] = 1;
    return 
1;

And i put this OnPLayerEnterCheckpoint
PHP код:
else if(IsTruckerStart[playerid] == && ccar && IsATruck(tmpcar))
    {
        if(
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
        {
            
DisablePlayerCheckpoint(playerid);
            new 
randtrucker 30000 random(20000);
            
format(string,sizeof(string),"{FFFF00}You received %s$ for your work.",FormatNumber(randtrucker));
            
SCM(playerid,COLOR_WHITE,string);
            
GivePlayerCash(playerid,randtrucker);
            
Update(playeridpCashx);
        }
        else return 
SendClientMessage(playerid,COLOR_YELLOW,"Where is the Trailer? ");
    } 
BUT when i enter in checkpoint not give me money and not disable checkpoint, why? PLS


Re: What is wrong? - bgedition - 12.06.2015

May be you need to use GivePlayerMoney, not GivePlayerCash.. or you have anti money hack??

EDIT: And I will suggest you to use streamer plugin. Because of that you can set the id of checkpoints and you can disable it by Id for player. https://sampforum.blast.hk/showthread.php?tid=102865


Re: What is wrong? - Sn4ke2 - 12.06.2015

i have streamer, i have all, not GivePlayerMoney is problem


Re: What is wrong? - Matess - 12.06.2015

What is ccar, give us more code from OnPlayerEnterCheckpoint


Re: What is wrong? - Prokill911 - 12.06.2015

Uh...
Well the reason it's not giving money == GivePlayerCash..

It's

GivePlayerMoney(playerid, amount);


PHP код:
else if(IsTruckerStart[playerid] == && ccar && IsATruck(tmpcar))
    {
        if(
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
        {
            
DisablePlayerCheckpoint(playerid);
            new 
randtrucker 30000 random(20000);
            
format(string,sizeof(string),"{FFFF00}You received %s$ for your work.",FormatNumber(randtrucker));
            
SCM(playerid,COLOR_WHITE,string);
            
GivePlayerMoney(playeridrandtrucker);
            
Update(playeridpCashx);
        }
        else return 
SendClientMessage(playerid,COLOR_YELLOW,"Where is the Trailer? ");
    } 

Try that