1
Scripting SA-MP [Pawn center] / Re : Comment loader des position pour un [FS]Race
« le: 26 Mai 2012, 18:22:04 »
up :wall
Cette section vous permet de consulter les contributions (messages, sujets et fichiers joints) d'un utilisateur. Vous ne pourrez voir que les contributions des zones auxquelles vous avez accès.
SetPlayerRaceCheckpoint(playerid,2, ici X, ici Y, ici Z, x+5, y+5, z, 5);
{
{
new string[128];
new Float:X, Float:Z, Float:Y, Float:Rotation; // Floats to save the pos in
if (strcmp(cmdtext, "/test", true)==0)
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Rotation);
new File:pos=fopen("positions.txt", io_append);
format(string, 256, "X = %f\r\nY = %f\r\nZ = %f\r\n", X, Y, Z);
fwrite(pos, string);
fclose(pos);
return 1;
}
}
if (strcmp(cmdtext, "/te", true)==0)
{
new string[128]; // Create the string to store the read text in
new File:example = fopen("positions.txt", io_read); // Open the file
fread(example, string);
fclose(example);
//SetPlayerRaceCheckpoint(playerid,2, %s, %s, %s, x+5, y+5, z, 5);
printf("%s",string); // Print what was read
return 1;
}
return 0;
}
public AddStaticVehicle2(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
{
if(gVC<=MAX_CARS)
{
gVC++;
gVehicleClass[gVC] = modelid;
Remplace AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
Par
AddStaticVehicleEx ( modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, TEMP DE RESPAWN A changer par Exemple >15 );
}
}
veh[Random] = AddStaticVehicle(...);
veh[Random] = AddStaticVehicle(...);
Olieu de veh[1] = AddStaticVehicle(...);
veh[2] = AddStaticVehicle(...); etc
Merci d'avance :)
new vehcicle[50];
vehicle[1] = addstaticvehicle
ou vehicle = addstaticvehicle ?
boucle plus action signifie ? for(new slot = vehicle[50]; slot < 50; slot++)
{
SetVehicleVirtualWorld(slot,3);
}
Ceci est un brouillon que j'ai fait sur place ^^ je ne c'est pas crée la boucle justement après pour le tableau bah j'ésite entre les deux possibilité :s merci d'avance bonne aprem :)
public AddStaticVehicleA(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
{ new A;
A = AddStaticVehicleA(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
for(new slot = 0; slot < 15; slot++)
{
SetVehicleVirtualWorld(A,3);
}
{
AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
}
return 1;
}
New VehiculeClass1; ou New VehiculeClass1[50]; [50 Pour 49 ou 48 Vehicules par exemple].
New vehiculesClass1 Ou(Vehiculesclass1[1] = AddStaticVehicle(519,1806.1066,-2406.8108,14.4731,220.1901,1,1);
New vehiculesClass1 Ou Vehiculesclass1[2] = AddStaticVehicle(519,1851.0873,-2397.0818,14.4738,221.0776,1,1) ;
New vehiculesClass1 Ou Vehiculesclass1[3] = AddStaticVehicle(519,1881.2903,-2364.6726,14.4760,231.6925,1,1) ;
New vehiculesClass1 Ou Vehiculesclass1[4] = AddStaticVehicle(593,1990.4940,-2400.4700,14.0069,126.8314,58,8) ;
SetVehicleVirtualWorld(VehiculesClass1,3);
Ou Bien ; setVehicleVirtualWorld(Vehiculesclass1[1],3); etc..
for(new car= 0 < 50; c++)
{
L'action
}
Mais bon :s c pas du tout sa j'ai besoin de votre aide pour rassemblé dans un seul New tout les AddStaticVehicle