I don't have any : OnPlayerRequestSpawn.
Код:
}
public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);
if (PLAYERLIST_authed[playerid])
{
// new nome[ 256 ];
// format(nome, sizeof(nome),"14[SPAWNED] [%s - %d] %s[%d] has spawned.",AdminLevelName(playerid),PlayerInfo[playerid][power], PlayerName(playerid),playerid);
// iEcho( nome );
StopAudioStreamForPlayer(playerid);
Killing_Spree_Count[playerid] = 0;
//SetTimerEx("StopSpectate", 100, false, "d", playerid);
//SetTimerEx("JustSpawned", 180000, false, "dd", playerid,0);
if(!gPlayerAnimLibsPreloaded[playerid])
{
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
gPlayerAnimLibsPreloaded[playerid] = 1;
}
StopPlayerHoldingObjectEx(playerid);
SetPVarInt(playerid, "Tazer", 0);
SetPVarInt(playerid, "BriefCaseTill", 0);
if(GetPVarInt(playerid, "SkinSelect") == 1)
{
SetTimerEx("SetPlayerBack", 350, false, "dd", playerid,1);
new tmpid=IsPlayerInBiz(playerid);
if(tmpid!=-1)
{
new filename[50],tmpbank;
format(filename,sizeof(filename),"%s.txt",biz[tmpid][bizname]);
tmpbank=dini_Int(filename,"bizcash");
dini_IntSet(filename,"bizcash",tmpbank+1000);
GivePlayerMoneyEx(playerid,-1000);
PlayerTemp[playerid][spawnrdy]=0;
}
return 1;
}
TextDrawHideForPlayer(playerid, plrwarning[playerid]);
TextDrawHideForPlayer(playerid, jailtd[playerid]);
TextDrawHideForPlayer(playerid, InjuredTD);
PlayerTemp[playerid][HasRedScreen] = 0;
SetPVarInt(playerid, "GarageID", -1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
TextDrawHideForPlayer(playerid, PlayerTemp[playerid][InfoBox]);
TextDrawHideForPlayer(playerid, LocationTD[playerid]);
TextDrawHideForPlayer(playerid, Harvest[playerid]);
TextDrawHideForPlayer(playerid, Cargo[playerid]);
PlayerTemp[playerid][isevent] = 0;
if(PlayerTemp[playerid][adminduty])
{
SendClientMessage(playerid, COLOR_LIGHTGREY, " Info: You are still on adminduty! You cannot roleplay!");
SetTimerEx("AdminDutyFunction", 1200, false, "d", playerid);
}
SetPlayerArmour(playerid, 0.0);
TextDrawShowForPlayer(playerid, PlayerTemp[playerid][Status]);
TextDrawShowForPlayer(playerid, LocationTD[playerid]);
TextDrawShowForPlayer(playerid, TextDraw__News);
TextDrawShowForPlayer(playerid, IMtxt);
TextDrawHideForPlayer(playerid, TellTD);
TextDrawHideForPlayer(playerid, Black0);
TextDrawHideForPlayer(playerid, Black1);
TextDrawHideForPlayer(playerid, Logo);
new Float:px,Float:py,Float:pz;
if(MoneyCheckEx(playerid)) return 1;
GetPlayerPos(playerid,px,py,pz);
PlayerPlaySound(playerid,SOUND_GOGO_TRACK_STOP,px,py,pz);
SetPlayerHealth(playerid,100);
for(new q; q < sizeof(Gangzones); q++)
{
GangZoneShowForPlayer(playerid, Gangzones[q][gID], GetFactionTurfColour(Gangzones[q][gFACTION]));
TextDrawHideForPlayer(playerid, Gangzones[q][gDRAW]);
if(Gangzones[q][gBLINK] == 1) GangZoneFlashForPlayer(playerid, Gangzones[q][gID], COLOR_WHITE);
}
if(PlayerInfo[playerid][jailtime]>1 || PlayerInfo[playerid][jail])
{
PlayerTemp[playerid][imprisoned] = 1;
Jail(playerid,PlayerInfo[playerid][jailtime],PlayerInfo[playerid][bail],PlayerInfo[playerid][jailreason]);
return 1;
}
else
{
if(IsPlayerInPaintball(playerid))
{
SetPlayerPaintBall(playerid, PlayerTemp[playerid][onpaint], PlayerTemp[playerid][pbteam]);
return 1;
}
SetTimerEx("CheckCrash", 750, false, "d", playerid);
if(PlayerInfo[playerid][housenum]==-1) DefaultSpawn(playerid);
else HouseSpawn(playerid, PlayerInfo[playerid][housenum]);
/*if(PlayerInfo[playerid][housenum]==-1)
{
switch(PlayerInfo[playerid][playerteam])
{
case COPS:
{
SetPlayerInterior(playerid,3);
SetPlayerVirtualWorld(playerid,20);
CheckCrash(playerid);
}
case CIV, 0:
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
CheckCrash(playerid);
}
case SASF:
{
switch(PlayerInfo[playerid][pdspawn])
{
case 0:
{
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 1);
CheckCrash(playerid);
}
case 1:
{
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, 0);
CheckCrash(playerid);
}
}
}
case 1..6,8,9,11,12,FBI,KEMIROV:
{
for(new q=0;q<sizeof(hq);q++)
{
if(hq[q][hqid]==GetPlayerTeam(playerid))
{
SetPlayerInterior(playerid,hq[q][hqinterior]);
SetPlayerVirtualWorld(playerid,hq[q][vhq]);
CheckCrash(playerid);
if(PlayerInfo[playerid][playerteam] == FBI) GivePlayerWeapon(playerid, 43, 200); // CAMERA
return 1;
}
}
}
}
}
else
{
PlayerTemp[playerid][tmphouse]=PlayerInfo[playerid][housenum];
new filename[MAX_STRING],hinterior;
format(filename,sizeof(filename),"Casa%d.txt",PlayerInfo[playerid][housenum]);
hinterior=dini_Int(filename,"interiorpack");
SetPlayerInterior(playerid,interiorpack[hinterior][_interior]);
SetPlayerVirtualWorld(playerid,House[PlayerInfo[playerid][housenum]][_Hvirtual]);
SetPlayerPos(playerid,interiorpack[hinterior][_intx],interiorpack[hinterior][_inty],interiorpack[hinterior][_intz]);
CheckCrash(playerid);
if(PlayerInfo[playerid][ranklvl] == 0) ResetPlayerWeapons(playerid), GivePlayerWeapon(playerid, WEAPON_DEAGLE, 300);
if(PlayerInfo[playerid][playerteam] == HITMAN) GivePlayerWeapon(playerid, WEAPON_KNIFE, -1);
if(PlayerInfo[playerid][playerteam] == FBI) GivePlayerWeapon(playerid, 43, 200); // CAMERA
return 1;
}*/
}
}
else
{
switch(random(2))
{
case 0:
{
SetPlayerCameraPos(playerid,967.4384,2559.5483,10.7003);
SetPlayerCameraLookAt(playerid,982.4874,2561.6409,22.5239);
SetPlayerPos(playerid,967.4384,2559.5483,5.7003);
}
case 1:
{
SetPlayerCameraPos(playerid,2058.8811,971.7955,54.5982);
SetPlayerCameraLookAt(playerid,2057.1230,1189.4883,39.5329);
SetPlayerPos(playerid,2058.8811,971.7955,47.5982);
}
case 2:
{
SetPlayerCameraPos(playerid,2372.1680,2141.8135,31.8135);
SetPlayerCameraLookAt(playerid,2299.5005,2142.6213,28.8228);
SetPlayerPos(playerid,2372.1680,2141.8135,27.8135);
}
}
SetPlayerInterior(playerid,0);
// SetPlayerPos(playerid,1159.6266,-1336.6754,31.5049);
// SetPlayerCameraPos(playerid, 1208.0786,-1283.8859,63.5066);
// SetPlayerCameraLookAt(playerid, 1131.7056,-1404.7975,50.6634);
SetPlayerColor(playerid, COLOR_RED);
TogglePlayerControllable(playerid,false);
//SetTimerEx("StartSpectateEx", 100, false, "d", playerid);
return 1;
}
return 0;
}
Код:
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response == 1 || dialogid == 1 && response == 0)
{
dcmd_registerex(playerid, inputtext);
return 1;
}
if(dialogid == 2 && response)
{
dcmd_loginex(playerid, inputtext);
return 1;
}
else if(dialogid == 2 && !response) return Kick(playerid);
if(dialogid == 3 && response == 1)
{
dcmd_changepass(playerid, inputtext);
return 1;
}
else if(dialogid == 3 && response == 0) return SendClientMessage(playerid, COLOR_RED, "Cancelled.");
if(dialogid == 4 && response == 1)
{
new smsprice = dini_Int(globalstats,"sms");
new msg[MAX_STRING], sms[MAX_STRING], giveplayerid = PlayerTemp[playerid][playertosms], message[MAX_STRING];
format(msg,sizeof(msg),"~w~sms sent~n~cost: ~b~%d",smsprice);
GameTextForPlayer(playerid,msg,3000,1);
GivePlayerMoneyEx(playerid,-smsprice);
format(sms,MAX_STRING,"SMS from %s(%d): %s",RPName(playerid),PlayerInfo[playerid][phonenumber],inputtext);
SendMessageToPlayer(giveplayerid,COLOR_PLAYER_DARKYELLOW,sms);
format(sms,MAX_STRING,"SMS sent to %s(%d): %s",RPName(giveplayerid),PlayerInfo[giveplayerid][phonenumber], inputtext);
SendMessageToPlayer(playerid,COLOR_PLAYER_DARKYELLOW,sms);
PlayerPlaySound(giveplayerid,SOUND_CHECKPOINT_AMBER,0.0, 0.0, 0.0);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerTemp[i][adminspy] == 1)
{
format(message, MAX_STRING, "(/sms) %s to %s: %s", PlayerName(playerid), PlayerName(PlayerTemp[playerid][playertosms]), inputtext);
SendClientMessage(i, COLOR_LIGHTGREY, message);
}
}
format( message, MAX_STRING, "7[SMS] %s[%d] to %s[%d]: %s",PlayerName(playerid), playerid, PlayerName(PlayerTemp[playerid][playertosms]), PlayerTemp[playerid][playertosms], inputtext);
iEcho( message );
PlayerTemp[playerid][playertosms] = 666;
new bizcash = dini_Int("Phone_Company.txt","bizcash");
dini_IntSet("Phone_Company.txt","bizcash",bizcash+smsprice);
return 1;
}
else if(dialogid == 4 && response == 0) return SendClientMessage(playerid, COLOR_RED, "Cancelled.");
if(dialogid == 5 && response == 1)
{
if(strlen(inputtext) < 10)
return SendClientMessage(playerid, COLOR_PLAYER_SPECIALBLUE, "* 911 Landline: Please tell us some more details. (min. 10 chars)");
new
string[MAX_STRING],
sender[ 30 ];
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger"); else myStrcpy(sender,RPName(playerid));
new zone[ 60 ];
GetPlayer3DZone(playerid, zone, sizeof(zone));
if(GetPlayerInterior(playerid)) myStrcpy(zone, "Unknown (( Interior ))");
SendClientMessageToTeam( COPS, "======== [ EMERGENCY CALL ] ========", COLOR_PLAYER_SPECIALBLUE);
SendClientMessageToTeam( FBI, "======== [ EMERGENCY CALL ] ========", COLOR_PLAYER_SPECIALBLUE);
format(string, sizeof(string), " Caller: %s Number: %d", sender, PlayerInfo[playerid][phonenumber]);
SendClientMessageToTeam( COPS, string, COLOR_WHITE);
SendClientMessageToTeam( FBI, string, COLOR_WHITE);
format(string, sizeof(string), " Traced location: %s", zone);
SendClientMessageToTeam( COPS, string, COLOR_WHITE);
SendClientMessageToTeam( FBI, string, COLOR_WHITE);
format(string, sizeof(string), " Incident: %s", inputtext);
SendClientMessageToTeam( COPS, string, COLOR_WHITE);
SendClientMessageToTeam( FBI, string, COLOR_WHITE);
SendClientMessageToTeam( COPS, "======================================", COLOR_PLAYER_SPECIALBLUE);
SendClientMessageToTeam( FBI, "======================================", COLOR_PLAYER_SPECIALBLUE);
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][playerteam] == COPS || PlayerInfo[i][playerteam] == FBI)
{
PlayerPlaySound(i,1056,0.0,0.0,0.0);
if(GetPlayerInterior(playerid) == 0) SetPlayerCheckpoint(i,px,py,pz,3);
}
}
SetPlayerSpecialAction(playerid,13);
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger");
else myStrcpy(sender,RPName(playerid));
format(string,sizeof(string),"(Phone) %s says: %s",sender,inputtext);
ProxDetectorEx(20.0, playerid, string);
SendClientMessage(playerid, COLOR_PLAYER_SPECIALBLUE, "* 911 Landline: Thank you for your call, have a nice day!");
return true;
}
else if(dialogid == 5 && response == 0) return SendClientMessage(playerid, COLOR_RED, " Your call has been cancelled.");
if(dialogid == 6 && response == 1)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 120)
return SendClientError(playerid, " The advertisement is too short or too long!");
if(strfind(inputtext, "83.169.9.101") != -1 || strfind(inputtext, ":7777") != -1 || strfind(inputtext, "212.150.176.32") != -1 || strfind(inputtext,":8593") != -1 || strfind(inputtext, "94.23.26.10") != -1 || strfind(inputtext, ":8425") != -1 || strfind(inputtext, "server") != -1 || strfind(inputtext, "109 . 169 . 40 . 105 : 7473") != -1)
return BanReas("SERVER",playerid,"IP Advertising", 1);
if(strfind(inputtext, "~") != -1)
return SendClientError(playerid, "You tried to use an invalid character!");
new adstr[256], string[ MAX_STRING ], phonestr[ 30 ];
if(PlayerInfo[playerid][phonenumber] == 0) myStrcpy(phonestr, "N/A");
else format(phonestr, 30, "%d", PlayerInfo[playerid][phonenumber]);
format(adstr,sizeof(adstr),"*** Advertisement by %s - Phone: %d ***", RPName(playerid),PlayerInfo[playerid][phonenumber]);
SendMessageToAll(COLOR_PLAYER_GREEN,adstr);
format(adstr,sizeof(adstr),"** %s **", inputtext);
SendMessageToAll(COLOR_PLAYER_GREEN,adstr);
new adprice; adprice=strlen(inputtext)*dini_Int(globalstats,"ad");
GivePlayerMoneyEx(playerid,-adprice);
ad=0;
SetTimer("ResetADV",60000,0);
new bizcash = dini_Int("Ad_Tower.txt","bizcash");
dini_IntSet("Ad_Tower.txt","bizcash",bizcash+adprice);
format( string, sizeof(string), "~g~%s (%d): %s", NoUnderscore(PlayerName(playerid)), PlayerInfo[playerid][phonenumber], inputtext);
TextDrawSetString(TextDraw__News, string);
format( string, sizeof(string), "3{ Advertisement } %s[%d]: %s",PlayerName(playerid), playerid, inputtext);
iEcho( string );
//format(adstr, sizeof(adstr), "action=ad&name=%s&phone=%d&text=%s&ip=%s", PlayerName(playerid), PlayerInfo[playerid][phonenumber], inputtext, PlayerTemp[playerid][IP]);
//HTTP(playerid, HTTP_POST, "www.im-rpg.com/misc/sec.php", adstr, "MyHttpResponse");
}
else if(dialogid == 6 && response == 0) return SendClientMessage(playerid, COLOR_RED, " Your call has been cancelled.");
if (dialogid == 9)
{
if (response == 1)
{
new tmpid=IsPlayerInBiz(playerid), nomefile[ 30 ];
if(tmpid!=-1 && biz[tmpid][biztype]==3 && GetPlayerVirtualWorld(playerid)==biz[tmpid][vbiz])
{
format(nomefile,sizeof(nomefile),"%s.txt",biz[tmpid][bizname]);
new tmpweapon[ 20 ];
switch (listitem)
{
case 0:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"deagle"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_DEAGLE,75);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"deagle"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"deagle"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 1);
SendClientInfo(playerid, "You have bought: Deagle (75)");
myStrcpy(tmpweapon, "Deagle");
}
case 1:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"mp5"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_MP5,250);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"mp5"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"mp5"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 1);
SendClientInfo(playerid, "You have bought: MP5 (250)");
myStrcpy(tmpweapon, "MP5");
}
/*
case 2:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"m4"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_M4,200);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"m4"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"m4"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 2);
SendClientInfo(playerid, "You have bought: M4 (200)");
myStrcpy(tmpweapon, "M4");
}
case 3:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"rifle"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_RIFLE,80);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"rifle"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"rifle"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 1);
SendClientInfo(playerid, "You have bought: Rifle (80)");
myStrcpy(tmpweapon, "Rifle");
}
case 4:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"ak47"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_AK47,200);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"ak47"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"ak47"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 2);
SendClientInfo(playerid, "You have bought: AK47 (200)");
myStrcpy(tmpweapon, "AK47");
}
case 5:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"shotgun"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_SHOTGUN,80);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"shotgun"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"shotgun"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 1);
SendClientInfo(playerid, "You have bought: Shotgun (80)");
myStrcpy(tmpweapon, "Shotgun");
}
*/
case 2:
{
if(PlayerInfo[playerid][ranklvl] > 1 && PlayerInfo[playerid][playerteam] != HITMAN || PlayerInfo[playerid][playerteam] == CIV)
return SendClientError(playerid, "You cant buy a sniper!");
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"sniper"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerWeapon(playerid,WEAPON_SNIPER,80);
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"sniper"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"sniper"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 3);
SendClientInfo(playerid, "You have bought: Sniper (80)");
myStrcpy(tmpweapon, "Sniper");
}
case 3:
{
if(PlayerTemp[playerid][sm]< dini_Int(nomefile,"armour"))
return SendClientError(playerid, "You don't have enough money");
GivePlayerMoneyEx(playerid,-dini_Int(nomefile,"armour"));
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + dini_Int(nomefile,"armour"));
dini_IntSet(nomefile,"comps",dini_Int(nomefile,"comps") - 1);
SendClientInfo(playerid, "You have bought: Armour");
myStrcpy(tmpweapon, "Armour");
SetPlayerArmour(playerid, 99);
}
}
new stringex[ 400 ], string[ 128 ];
format(stringex, sizeof(stringex), "Deagle \t\t($%d/75)\nMP5 \t\t($%d/250)\nSniper \t\t($%d/80)\nArmour \t\t($%d)", bizgunprice[tmpid][DEAGLE],bizgunprice[tmpid][MP5],bizgunprice[tmpid][SNIPER],bizgunprice[tmpid][ARMOUR]);
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Weapon Store", stringex, "Buy", "Cancel");
format(string, sizeof(string), "3{ WEAPON } %s has bought a weapon: %s.", PlayerName(playerid), tmpweapon);
iEcho(string);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
PlayerTemp[playerid][totalguns]++;
return 1;
}
else return SendClientError(playerid, "Not in a weaponstore.");
}
else return SendClientInfo(playerid, "Done.");
}