Help me please!! :( - 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: Help me please!! :( (
/showthread.php?tid=634334)
Help me please!! :( -
Alejandro041 - 16.05.2017
Hello, Somebody know how to compare ini values with loop? i use y_ini and i want that when a player enter on a car, gives a message like "This vehicle belongs to %s.." i make this code but doesn't work!! :C
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid... etc)
{
for(new b = 0; b < sizeof(DVehicles); b++)
{
new pname[24], string[256];
GetPlayerName(playerid, pname, 24);
format(string,sizeof(string),"{FFFFFF}This vehicle belongs to %s", DVehicles[b][Owner]);
SendClientMessage(playerid, -1, string);
}
return 1;
}
Enums of DVehicles
pawn Код:
enum vfInfo
{
dID,
dModel,
Float:dX,
Float:dY,
Float:dZ,
Float:dA,
dColor1,
dColor2,
Owner[24],
};
Re: Help me please!! :( -
Jefff - 16.05.2017
Show enum DVehicles
Respuesta: Re: Help me please!! :( -
Alejandro041 - 17.05.2017
Quote:
Originally Posted by Jefff
Show enum DVehicles
|
There is
Re: Help me please!! :( -
Jefff - 17.05.2017
DVehicles too xd
Respuesta: Re: Help me please!! :( -
Alejandro041 - 17.05.2017
Quote:
Originally Posted by Jefff
DVehicles too xd
|
DVehicles is vfInfo,
pawn Код:
enum vfInfo
{
dID,
dModel,
Float:dX,
Float:dY,
Float:dZ,
Float:dA,
dColor1,
dColor2,
Owner[24],
};
new DVehicles[MAX_VEHICLES][vfInfo];//*******
Re: Help me please!! :( -
Jefff - 17.05.2017
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid... etc)
{
new pname[24];
GetPlayerName(playerid, pname, 24);
if( DVehicles[vehicleid][Owner][0] && strcmp(name,DVehicles[vehicleid][Owner]) ) // if vehicle is not yours
{
new string[60];
format(string,sizeof(string),"{FFFFFF}This vehicle belongs to %s", DVehicles[vehicleid][Owner]);
SendClientMessage(playerid, -1, string);
return 1;
}
return 1;
}
Respuesta: Re: Help me please!! :( -
Alejandro041 - 17.05.2017
Doesn't work! :C Anyway thanks for attempt
Re: Help me please!! :( -
Jefff - 17.05.2017
It works only when someone wants enter to your vehicle
Respuesta: Re: Help me please!! :( -
Alejandro041 - 17.05.2017
Quote:
Originally Posted by Jefff
It works only when someone wants enter to your vehicle
|
OMG man i don't know what i do but it works!!!
Thanks
Re: Respuesta: Re: Help me please!! :( -
zedshadowzw - 17.05.2017
Quote:
Originally Posted by Alejandro041
OMG man i don't know what i do but it works!!! Thanks
|
lol good for you.