#1

Helo! i make a player textdraw for speedometer, all work only not
"Vehicle: X"
I found a include to get vehiclename and to show it and don't work.
If i make something like that is working
PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
String[128];
    
format(String,sizeof(String),"You are entering a(n) %s.",VehicleNames[GetVehicleModel(vehicleid) - 400]);
    
SendClientMessage(playerid,-1,String);
    return 
1;

But if i try to make this is don't work
PHP Code:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    
// intra in masina
    
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
         
SetTimerEx("speed"750true"i"playerid);
         new 
string1[128];
         
format(string1,sizeof(string1),"Vehicle: %s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
        
PlayerTextDrawSetString(playeridcartypestring1);
        
PlayerTextDrawShow(playeridcartype);
        
PlayerTextDrawShow(playerid,cartype);
    }
    
// IESE DIN MASINA GATA SPEEDU
    
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
    }
    return 
1;

PHP Code:
C:\Users\Calinacho\Desktop\server  samp\gamemodes\test.pwn(331) : error 017undefined symbol "vehicleid" 
Some help?
Reply
#2

here you're

PHP Code:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    
// intra in masina
    
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
         
SetTimerEx("speed"750true"i"playerid);
         new 
string1[128], vehicleid GetPlayerVehicleID(playerid);
         
format(string1,sizeof(string1),"Vehicle: %s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
        
PlayerTextDrawSetString(playeridcartypestring1);
        
PlayerTextDrawShow(playeridcartype);
        
PlayerTextDrawShow(playerid,cartype);
    }
    
// IESE DIN MASINA GATA SPEEDU
    
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
    }
    return 
1;

You forget to declare the vehicleid variable, thats all
Reply
#3

Quote:
Originally Posted by Nuginity
View Post
here you're

PHP Code:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    
// intra in masina
    
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
         
SetTimerEx("speed"750true"i"playerid);
         new 
string1[128], vehicleid GetPlayerVehicleID(playerid);
         
format(string1,sizeof(string1),"Vehicle: %s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
        
PlayerTextDrawSetString(playeridcartypestring1);
        
PlayerTextDrawShow(playeridcartype);
        
PlayerTextDrawShow(playerid,cartype);
    }
    
// IESE DIN MASINA GATA SPEEDU
    
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
    }
    return 
1;

You forget do declare the vehicleid variable, thats all
Thank you bro <3
Reply
#4

Quote:
Originally Posted by Calinut200
View Post
Thank you bro <3
Anytime dude
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)