13.03.2009, 19:39
In taxi fr gm when a player death crash. i have add some object.
Please Help
Please Help
Код:
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(killerid, 5000); SendDeathMessage(killerid,playerid,reason); return 1; }
Код:
public OnPlayerSpawn(playerid) { if(PlayerInfo[playerid][logged] == 0) { SendClientMessage(playerid, COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------------------------------------"); SendClientMessage(playerid,COLOR_YELLOW, "You have not logged in yet!"); SendClientMessage(playerid,COLOR_YELLOW, "Please register your current player name with '/register [password]' and login with '/login [password]'"); SendClientMessage(playerid, COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------------------------------------"); } SetPlayerColor(playerid,COLOR_GREY); switch(PlayerInfo[playerid][team]) { case TEAM_BALLA: { GivePlayerWeapon(playerid,32,100); GivePlayerWeapon(playerid,25,100); GivePlayerWeapon(playerid,4,1); SetPlayerColor(playerid,COLOR_PINK); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_GROVE: { GivePlayerWeapon(playerid,28,200); GivePlayerWeapon(playerid,30,200); GivePlayerWeapon(playerid,4,1); SetPlayerColor(playerid,COLOR_GREEN); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_VAGO: { GivePlayerWeapon(playerid,34,200); GivePlayerWeapon(playerid,24,400); GivePlayerWeapon(playerid,28,800); SetPlayerColor(playerid,COLOR_YELLOW); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_AZTEC: { GivePlayerWeapon(playerid,24,400); GivePlayerWeapon(playerid,31,800); GivePlayerWeapon(playerid,28,800); SetPlayerColor(playerid,COLOR_BLUE); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_TRIAD: { GivePlayerWeapon(playerid,27,100); GivePlayerWeapon(playerid,30,200); GivePlayerWeapon(playerid,4,1); SetPlayerColor(playerid,COLOR_YELLOW); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_MEDIC: { GivePlayerWeapon(playerid,27,100); GivePlayerWeapon(playerid,28,200); GivePlayerWeapon(playerid,4,1); SetPlayerColor(playerid,COLOR_LIGHTBLUE); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_PTF: { GivePlayerWeapon(playerid,31,800); GivePlayerWeapon(playerid,24,800); GivePlayerWeapon(playerid,27,800); SetPlayerColor(playerid,COLOR_BRIGHTRED); SetPlayerPos(playerid,2558.4133,1562.1017,10.8203); return 1; } case TEAM_COP: { GivePlayerWeapon(playerid,24,400); GivePlayerWeapon(playerid,31,400); GivePlayerWeapon(playerid,26,400); SetPlayerColor(playerid,COLOR_BLUE); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_IF: { GivePlayerWeapon(playerid,24,100); GivePlayerWeapon(playerid,31,200); GivePlayerWeapon(playerid,26,1); SetPlayerColor(playerid,COLOR_GREEN); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } case TEAM_CIV: { GivePlayerWeapon(playerid,28,200); GivePlayerWeapon(playerid,30,200); GivePlayerWeapon(playerid,4,1); SetPlayerColor(playerid,COLOR_ORANGE); if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) { SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]); SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business"); return 1; } SetPlayerRandomSpawn(playerid); } } GivePlayerWeapon(playerid,4,1); return 1; } stock CountVehicles(filename[]) { new File:VehicleFile; new blank[256]; new count = 0; if (fexist(V_FILE_SAVE)) { VehicleFile = fopen(V_FILE_SAVE); while(fread(VehicleFile, blank, sizeof blank)) { count++; } fclose(VehicleFile); } else { VehicleFile = fopen(filename); while(fread(VehicleFile, blank, sizeof blank)) { count++; } fclose(VehicleFile); } return count; } stock CountBusinesses(filename[]) { new File:BusinessFile; new blank[256]; new count = 0; if (fexist(B_FILE_SAVE)) { BusinessFile = fopen(B_FILE_SAVE); while(fread(BusinessFile, blank, sizeof blank)) { count++; } fclose(BusinessFile); } else { BusinessFile = fopen(filename); while(fread(BusinessFile, blank, sizeof blank)) { count++; } fclose(BusinessFile); } return count; } stock split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc[i]==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 128); strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; }