Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------[Whisper]-----------------------------------------------
- if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/w)hisper [ID Igraca/Deo Imena] [whisper text]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if (IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(giveplayerid,x,y,z);
- if(PlayerToPoint(5, playerid, x, y, z))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- if(giveplayerid == playerid)
- {
- format(string, sizeof(string), "* %s brblja nesto sebi.", sendername);
- ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- format(string, sizeof(string), "* %s sapce nesto %s-u", sendername, giveplayer);
- ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[256];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/w)isper [ID Igraca/Deo Imena] [whisper text]");
- return 1;
- }
- new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
- for(new b = 0; b < sizeof brojevi; b++)
- {
- new tekst = strlen(result);
- for(new a = 0; a<tekst; a++)
- {
- if(result[a] == brojevi[b])
- result[a] = '*' ;
- }
- }
- format(string, sizeof(string), "%s sapce: %s", sendername, (result));
- SendClientMessage(giveplayerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "%s sapce: %s", sendername, (result));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Igrac nije blizu vas!");
- return 1;
- }
- }
- }
- else
- {
- format(string, sizeof(string), " %d nije aktivan igrac.", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
- //----------------------------------[Car Whisper]-----------------------------------------------
- if(strcmp(cmd, "/cw", true) == 0 || strcmp(cmd, "/carwhisper", true) == 0 || strcmp(cmd, "/cwhisper", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili!");
- return 1;
- }
- if(!IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " Niste u autu!");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/cw)hisper [text]");
- return 1;
- }
- new vehicle = GetPlayerVehicleID(playerid);
- foreach (Player, i)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- if(GetPlayerVehicleID(i) == vehicle)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- format(string, sizeof(string), "Vozac %s kaze: %s", sendername, result);
- SendClientMessage(i, 0xD7DFF3AA, string);
- }
- else
- {
- format(string, sizeof(string), "Putnik %s kaze: %s", sendername, result);
- SendClientMessage(i, 0xD7DFF3AA, string);
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement