1° Come fare in modo che quando un player fa /base (o qualche altro comando) possa essere spawnato in punti diversi :
a) prendere le coordinate dei punti
aprire i vostro pwn e fare così :
Prima di tutto vi calcolate quanti sono i punti in cui spawnare poi fare questo sotto il cmd esempio :
public OnPlayerCommandText(playerid , cmdtext[]) { if(strcmp(cmdtext , "/base" , true)==0) { new artcery = random(4); // AL POSTO DI 4 METTETE IL NUMERO DEI POSTI IN CUI VOLETE SPAWNARE switch(artcery) { case 0:{ SetPlayerPos(playerid, x , y , z); // coordinate primo spawn //altre funzioni } case 1:{ SetPlayerPos(playerid, x , y , z); // coordinate secondo spawn //altre funzioni } case 2:{ SetPlayerPos(playerid, x , y , z); // coordinate terzo spawn //altre funzioni } case 3:{ SetPlayerPos(playerid, x , y , z); // coordinate quarto spawn //altre funzioni } } return 1; } return 0; }
Facile asd ora la seconda:
2° Come Fare In Modo che quando uno muore le sue armi vengano spawnate a terra
In Cima
#define DROPDESTTIME 30000 #define DROPDISTANCE 2.0 forward DestPickup(id); new gIsDropW[100]; new gDropID[100]; new gDropAmmo[100]; new timdel; new weapons[] = { -1, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, -1, -1, -1, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, -1, 365, 366, 367, -1, -1, 371 };
in onplayerdeath
new tID; new pID; new tAmmo; new Float:x, Float:y, Float:z; for(new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, tID, tAmmo); if(tAmmo > 0) { if(weapons[tID] != -1) { pID = CreatePickup(weapons[tID], 19, x + floatcos((float(i) / 13.0 + i % 4) * 90.0, degrees) * DROPDISTANCE, y + floatsin((float(i) / 13.0 + i % 4) * 90.0, degrees) * DROPDISTANCE, z); gIsDropW[pID] = 1; gDropID[pID] = tID; gDropAmmo[pID] = tAmmo; SetTimerEx("DestPickup", DROPDESTTIME, 0, "%d", pID); } } }
In onplayerpickuppickup
public OnPlayerPickUpPickup(playerid, pickupid) { if(gIsDropW[pickupid]) { GivePlayerWeapon(playerid, gDropID[pickupid], gDropAmmo[pickupid]); DestroyPickup(pickupid); gIsDropW[pickupid] = 0; } return 1; }
In destpickup
public DestPickup(id) { DestroyPickup(id); gIsDropW[id] = 0;
facile anche qst asd
}
3° Come fare degli annunci che spuntano ogni quanto volete voi
in cima
#define ANNOUNCEMENT 0xFFFF00AA new Msg; new Announcements[6][128] = { // 6 e il numero dei msg "TUO MSG", "TUO MSG", "TUO MSG", "TUO MSG", "TUO MSG", "TUO MSG" }; forward GlobalAnnouncement();
ongamemodeinit
Msg = 0;
in globalannouncement
public GlobalAnnouncement() { switch (Msg) { case 0: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[0]); Msg++;} // first message case 1: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[1]); Msg++;} case 2: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[2]); Msg++;} // first message case 3: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[3]); Msg--;} case 4: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[4]); Msg--;} // first message case 5: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[5]); Msg--;} } return 1; }
Grx per la vostra attenzione spero sia servita