OnPlayerStateChange problem......... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerStateChange problem......... (
/showthread.php?tid=71167)
OnPlayerStateChange problem......... -
Castle - 30.03.2009
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
Re: OnPlayerStateChange problem......... -
tom_jonez - 30.03.2009
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.
Re: OnPlayerStateChange problem......... -
Castle - 31.03.2009
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
Re: OnPlayerStateChange problem......... -
Castle - 31.03.2009
*BUMP*
Any1 !?