Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ~~~~~~ CopyRight ~~~~~~ //
- /* Du darfst:
- - Das Script benutzen
- - Das Script Editieren
- Du darfst nicht:
- - Das Script veröffentlichen
- - Das Script publiziern
- - Das Script verkaufen
- - Das Script als deines Ausgeben
- - Copy Right umgehen
- - Copy Right unwirksam machen
- - Copy Right Umschreiben(Editieren)
- - Copy Right entfernen
- */
- // ~~~~~~ CopyRight Ende ~~~~~~ //
- #define FILTERSCRIPT
- #include <a_samp>
- #include <ocmd>
- #include <sscanf2>
- #define BLAU 0x0087FFFF
- #define ROT 0xE10000FF
- #define GELB 0xFFE600FF
- #define GRUEN 0x00FF00FF
- #define LILA 0xFF00FFFF
- #define GRAU 0x0FFF00FF
- enum AHandy
- {
- AnruferID
- }
- new Anrufer[MAX_PLAYERS][AHandy];
- new Telefoniert[MAX_PLAYERS];
- new HandyKlingelt[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Handy System by HellYeah Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- }
- #endif
- public OnPlayerText(playerid, text[])
- {
- if(Telefoniert[playerid] == 1)
- {
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- if(Anrufer[i][AnruferID] == playerid)
- {
- new str[128], GetName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,GetName,sizeof(GetName));
- format(str,128,"Handy %s: %s",GetName,text);
- SendClientMessage(playerid,GRUEN,str);
- SendClientMessage(i,GRUEN,str);
- return 0;
- }
- }
- }
- if(strlen(text) > 128) return 0;
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- new string[280];
- format(string,sizeof string,"%s sagt: %s",SpielerName(playerid),text);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerInRangeOfPoint(i,20,x,y,z))
- {
- SendClientMessage(i,GRAU,string);
- }
- }
- }
- return 0;
- }
- ocmd:anrufen(playerid, params[])
- {
- new pID, string[128], string2[128];
- if(sscanf(params,"u",pID))return SendClientMessage(playerid,ROT,"/anrufen [ID]");
- if(IsPlayerConnected(pID))
- {
- if(Telefoniert[pID] == 1)
- {
- return SendClientMessage(playerid,GRAU,"Besetzt...");
- }
- else
- {
- format(string,sizeof(string),"Du wirst von %s angerufen. Benutze /p um abzunehmen.",SpielerName(playerid));
- SendClientMessage(pID,GELB,string);
- format(string2,sizeof(string2),"Du rufst %s an, warte einen Moment.",SpielerName(pID));
- SendClientMessage(playerid,GELB,string2);
- format(string,sizeof(string),"Das Handy von %s klingelt...",SpielerName(pID));
- ProxDetector(40.0, pID, string, GELB,GELB,GELB,GELB,GELB);
- HandyKlingelt[pID] = 1;
- Telefoniert[playerid] = 1;
- Anrufer[pID][AnruferID]= playerid;
- Anrufer[playerid][AnruferID]= pID;
- return 1;
- }
- }
- return 1;
- }
- ocmd:p(playerid, params[])
- {
- if(HandyKlingelt[playerid] == 1)
- {
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- if(Anrufer[i][AnruferID] == playerid)
- {
- new string[128],string2[128], xname[MAX_PLAYER_NAME], xname2[MAX_PLAYER_NAME];
- GetPlayerName(i,xname,sizeof(xname));
- GetPlayerName(playerid,xname2,sizeof(xname2));
- format(string,sizeof(string),"Du hast den Anruf von %s angenommen. Tippe /h um aufzulegen.",xname2);
- format(string2,sizeof(string2),"%s hat abgehoben. Tippe /h um aufzulegen.",xname);
- SendClientMessage(playerid,GRAU,string);
- SendClientMessage(i,GRAU,string2);
- SetPlayerSpecialAction(i,SPECIAL_ACTION_USECELLPHONE);
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
- Telefoniert[i] = 1;
- Telefoniert[playerid] = 1;
- HandyKlingelt[i] = 0;
- return 1;
- }
- }
- }
- return 1;
- }
- ocmd:h(playerid, params[])
- {
- if(Telefoniert[playerid] == 1)
- {
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- if(Anrufer[i][AnruferID] == playerid)
- {
- new string[128],string2[128],xname[MAX_PLAYER_NAME];
- GetPlayerName(i,xname,sizeof(xname));
- format(string,sizeof(string),"Der Anruf mit %s ist beendet.",xname);
- format(string2,sizeof(string2),"Es wurde aufgelegt...");
- SendClientMessage(playerid,GRAU,string);
- SendClientMessage(i,GRAU,string2);
- SendClientMessage(playerid,ROT,"Das Gespräch hat 50$ Gekostet!");
- SetPlayerSpecialAction(i,SPECIAL_ACTION_STOPUSECELLPHONE);
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
- Telefoniert[i]= 0, Telefoniert[playerid]= 0;
- HandyKlingelt[playerid]= 0, HandyKlingelt[i]= 0;
- GivePlayerMoney(playerid,-50);
- GivePlayerMoney(playerid,-50);
- return 1;
- }
- }
- }
- return 1;
- }
- ocmd:sms(playerid,params[])
- {
- new text[128], string[128], string2[128], pID, xname[MAX_PLAYER_NAME];
- if(sscanf(params,"us",pID,text))
- {
- return SendClientMessage(playerid,ROT,"/sms [ID] [Text]");
- }
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerConnected(pID))
- {
- format(string,sizeof(string),"SMS von %s: %s",xname,text);
- SendClientMessage(pID,GELB,string);
- format(string2,sizeof(string2),"Deine SMS: %s: %s",xname,text);
- SendClientMessage(playerid,GELB,string2);
- GivePlayerMoney(playerid,-25);
- SendClientMessage(playerid,ROT,"Die SMS kostet 25$");
- return 1;
- }
- }
- return 1;
- }
- stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))SendClientMessage(i, col1, string);
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))SendClientMessage(i, col2, string);
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))SendClientMessage(i, col3, string);
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))SendClientMessage(i, col4, string);
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))SendClientMessage(i, col5, string);
- }
- }
- return 1;
- }
- stock SpielerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement