OnPlayerStateChange problem.........
#1

I made this Text that should appear when the player enters the car as Driver.
Somehow I can't make this Text script:
pawn Код:
new coVehicle = GetPlayerStreamVehicleID(playerid);
    if(GetCreatorID(coVehicle)!=0)
    {
        if (strmatch(VehicleSystem[GetCreatorID(coVehicle)][owner],Spielername(playerid)))
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
        else if(strmatch(VehicleSystem[GetCreatorID(coVehicle)][owner],"dealercar"))
        {  
            if(!IsPlayerAdmin(playerid)){ TogglePlayerControllable(playerid,0); }
            new fffx[128];
            format(fffx,sizeof(fffx),"This Vehicle is for Sale. Price %d$",VehicleSystem[GetCreatorID(coVehicle)][preis]);
            SendClientMessage(playerid,COLOR_WHITE,fffx);
            SendClientMessage(playerid,COLOR_YELLOW,"Use /buyveh to Buy it.");
        }
        else
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
    }
Show when the player enters the Car that Belongs to the System....

Here is the full OnPlayerStateChange
http://pastebin.com/d3ccb4762

Please help
Tried almost anything that Came to my mind on how to make it work
Reply
#2

pawn Код:
new coVehicle = GetPlayerStreamVehicleID(playerid);
    if(GetCreatorID(coVehicle)!=0)
    {
        if (!strcmp(VehicleSystem[GetCreatorID(coVehicle)][owner],Spielername(playerid),true))
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
        else if(!strcmp(VehicleSystem[GetCreatorID(coVehicle)][owner],"dealercar",true))
        {  
            if(!IsPlayerAdmin(playerid)){ TogglePlayerControllable(playerid,0); }
            new fffx[128];
            format(fffx,sizeof(fffx),"This Vehicle is for Sale. Price %d$",VehicleSystem[GetCreatorID(coVehicle)][preis]);
            SendClientMessage(playerid,COLOR_WHITE,fffx);
            SendClientMessage(playerid,COLOR_YELLOW,"Use /buyveh to Buy it.");
        }
        else
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
    }
try that, unless u made a command called strmatch, theres no such thing, so use strcmp.
Reply
#3

Quote:
Originally Posted by R4nk3d
pawn Код:
new coVehicle = GetPlayerStreamVehicleID(playerid);
    if(GetCreatorID(coVehicle)!=0)
    {
        if (!strcmp(VehicleSystem[GetCreatorID(coVehicle)][owner],Spielername(playerid),true))
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
        else if(!strcmp(VehicleSystem[GetCreatorID(coVehicle)][owner],"dealercar",true))
        {  
            if(!IsPlayerAdmin(playerid)){ TogglePlayerControllable(playerid,0); }
            new fffx[128];
            format(fffx,sizeof(fffx),"This Vehicle is for Sale. Price %d$",VehicleSystem[GetCreatorID(coVehicle)][preis]);
            SendClientMessage(playerid,COLOR_WHITE,fffx);
            SendClientMessage(playerid,COLOR_YELLOW,"Use /buyveh to Buy it.");
        }
        else
        {
            new ex[128];
            format(ex,sizeof(ex),"[ Vehicle Owner: %s ]",VehicleSystem[GetCreatorID(coVehicle)][owner]);
            SendClientMessage(playerid,COLOR_YELLOW,ex);
        }
    }
try that, unless u made a command called strmatch, theres no such thing, so use strcmp.
Tried it, Doesn't Work
Reply
#4

*BUMP*
Any1 !?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)