09.11.2015, 15:26
Hi
I have this stock
How can I make that it will randomize the positon of spawning when joining the derby
I have this stock
How can I make that it will randomize the positon of spawning when joining the derby
PHP код:
stock JoinDerby(playerid, DerbyID)
{
if(DerbyInfo[DerbyID][derbyjoinable] == false) return SendClientMessage(playerid, -1, "Derby is currently not joinable!");
VehicleSpawner(playerid,DerbyInfo[DerbyID][derbyvehicle]);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleVirtualWorld(vehicleid, 23);
SetPlayerVirtualWorld(playerid, 23);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehiclePos(vehicleid, DerbyInfo[DerbyID][spawnpointx], DerbyInfo[DerbyID][spawnpointy], DerbyInfo[DerbyID][spawnpointz]);
SetVehicleZAngle(vehicleid, DerbyInfo[DerbyID][spawnpointa]);
return 1;
}
Код:
new Derby1 = CreateDerby("Water Derby", 451); AddSpawnToDerby(Derby1,3032.8792,536.6260,42.2847,276.6157); AddSpawnToDerby(Derby1,2946.8621,388.5932,25.1934,324.0042); AddSpawnToDerby(Derby1,2888.6335,528.7598,4.1510,268.8276); AddSpawnToDerby(Derby1,2920.6140,494.4655,23.6494,359.9617); AddSpawnToDerby(Derby1,2968.3506,430.4344,12.4151,358.0193);
Код:
CMD:derbys(playerid,params[]) { new DerbyInfoString[600]; for(new x; x<currentderbyslot; x++) { if(DerbyInfo[x][derbyjoinable] == true) format(DerbyInfoString, sizeof(DerbyInfoString), "%s%s(ID:%d) {00FF00}[RACE JOINABLE]{FFFFFF}\n", DerbyInfoString, DerbyInfo[x][derbyname], x); else if(DerbyInfo[x][derbyrunning] == true) format(DerbyInfoString, sizeof(DerbyInfoString), "%s%s(ID:%d) {FF0000}[RACE RUNNING]{FFFFFF}\n", DerbyInfoString, DerbyInfo[x][derbyname], x); else format(DerbyInfoString, sizeof(DerbyInfoString), "%s%s(ID:%d) \n", DerbyInfoString, DerbyInfo[x][derbyname], x); } ShowPlayerDialog(playerid, 1236, DIALOG_STYLE_LIST, "LOL", DerbyInfoString, "Join", "Cancel"); return 1; }
Код:
stock AddSpawnToDerby(DerbyID,Float:SpawnPointX, Float:SpawnPointY, Float:SpawnPointZ,Float:SpawnPointA) { DerbyInfo[DerbyID][spawnpointx] = SpawnPointX; DerbyInfo[DerbyID][spawnpointy] = SpawnPointY; DerbyInfo[DerbyID][spawnpointz] = SpawnPointZ; DerbyInfo[DerbyID][spawnpointa] = SpawnPointA; return 1; }