[Pomoc] /w /sms

Započeo ...Nikola..., Jul 04, 2011, 11:11:30 PRE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

Skripta koju koristim: FactionGame
Detaljan opis problema: kako napraviti kada neko posalje SmS nekome ili mu sapne da adminu izadje kao u chat da vidi sta pise
Dio skripte:
if(strcmp(cmd, "/sms", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
		    new playercash;
		    playercash = GetPlayerMoney(playerid);
		    if (playercash < 2)
		    {
	            SendClientMessage(playerid, COLOR_GREY, "(greska)Nemate dovoljno novca na racunu!");
	            return 1;
		    }
		    if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "(greska)Niste se prijavili !");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /sms [brojtelefona] [Tekst Poruke]");
				return 1;
			}
			if(PlayerInfo[playerid][pPnumber] == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "(greska)Nemate telefon.");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s pise poruku.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			new phonenumb = strval(tmp);
			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: /sms [brojtelefona] [tekst]");
				return 1;
			}
			if(phonenumb == 555)
			{
				if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
				{
					SendClientMessage(playerid, COLOR_WHITE, "Poruka dostavljena.");
					if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
					{
						SendClientMessage(playerid, COLOR_YELLOW, "SMS: Nemam pojma o cemu pricas, Salje: MOLE (555)");
						RingTone[playerid] = 20;
						return 1;
					}
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_YELLOW, "SMS: Obicno Yes je dovoljno, Salje: MOLE (555)");
					RingTone[playerid] = 20;
					return 1;
				}
			}
			foreach (Player, i)
			{
					if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
					{
						giveplayerid = i;
						Mobile[playerid] = giveplayerid; //caller connecting
						if(IsPlayerConnected(giveplayerid))
						{
						    if(giveplayerid != INVALID_PLAYER_ID)
						    {
						        if(PhoneOnline[giveplayerid] > 0)
						        {
						            SendClientMessage(playerid, COLOR_GREY, "(greska)Igrac je offline!");
						            return 1;
						        }
								format(string, sizeof(string), "SMS: %s, Salje: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
								GetPlayerName(giveplayerid, sendername, sizeof(sendername));
								RingTone[giveplayerid] =20;
								SendClientMessage(playerid, COLOR_WHITE, "Poruka je poslata");
								SendClientMessage(giveplayerid, COLOR_YELLOW, string);
								SendClientMessage(playerid,  COLOR_YELLOW, string);
								format(string, sizeof(string), "~r~$-%d", txtcost);
								GameTextForPlayer(playerid, string, 5000, 1);
								SafeGivePlayerMoney(playerid,-txtcost);
								SBizzInfo[2][sbTill] += txtcost;
								ExtortionSBiz(2, txtcost);
					           	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					           	Mobile[playerid] = 255;
								return 1;
						}
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "Poruka nije poslata.");
		}
		return 1;
	}

if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "(greska)Niste se prijavili !");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/w)hisper [ID Igraca/Deo Imena] [tekst]");
				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 sebi.", sendername);
							ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						}
						else
						{
						    format(string, sizeof(string), "* %s sapuce %s", 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[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: (/w)isper [ID Igraca/Deo Imena] [tekst]");
							return 1;
						}
						format(string, sizeof(string), "%s sapuce: %s", sendername, (result));
						SendClientMessage(giveplayerid, COLOR_YELLOW, string);
						format(string, sizeof(string), "%s sapuce: %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;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /


[quote]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, "Koriscenje: (/w)hisper [ID Igraca/Dio 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[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, "Koriscenje: (/w)isper [ID Igraca/Dio Imena] [whisper text]");
							return 1;
						}
						format(string, sizeof(string), "%s sapce: %s", sendername, (result));
						SendClientMessage(giveplayerid, COLOR_DBLUE, string);
						format(string, sizeof(string), "%s sapce: %s", sendername, (result));
						SendClientMessage(playerid,  COLOR_DBLUE, 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;
	}
Poslednja Izmena: Jul 04, 2011, 12:29:24 POSLE PODNE od Petar_Black
Kome treba Skripter/Mapper neka mi posalje PM !!

Citat: Petar_Black poslato Jul 04, 2011, 12:26:27 POSLE PODNE
[quote]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, "Koriscenje: (/w)hisper [ID Igraca/Dio 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[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, "Koriscenje: (/w)isper [ID Igraca/Dio Imena] [whisper text]");
							return 1;
						}
						format(string, sizeof(string), "%s sapce: %s", sendername, (result));
						SendClientMessage(giveplayerid, COLOR_DBLUE, string);
						format(string, sizeof(string), "%s sapce: %s", sendername, (result));
						SendClientMessage(playerid,  COLOR_DBLUE, 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;
	}


dao si mu obicnu komanduxD..
if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Nisi se logiro");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)hisper [playerid/PartOfName] [ 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));
						new giveplayername[20]
                      GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                      
						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, "USAGE: (/w)isper [playerid/PartOfName] [text]");
							return 1;
						}
						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);
			         format(string, sizeof(string), "[WILDPROTECT]Sapce:%s | Odgovor: %s | Prima: %s", sendername, result, giveplayername);
                        for(new j=0;j<MAX_PLAYERS;j++)
                        {
                        if(BigEar[j]==1)
                        {
                        SendAdminMessage(COLOR_RED,string);
                        }
                        }
						return 1;
					}
					else
					{
					    SendClientMessage(playerid,  COLOR_GREY, "Igrac nije kod tebe");
					    return 1;
					}
				}
			}
			else
			{
					format(string, sizeof(string), "   %d taj igrac je online.", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}


za ovu komandu moras imat bigears i kad njega upalis onda mozes gledat ko sta pise na /w
Vratio sam se ponovo ocekjute novi server...

hmmm meni ispise cijeli chat to,a samo sam jednom /w :S


Edit: riješio sam
Poslednja Izmena: Jul 04, 2011, 12:59:38 POSLE PODNE od pHon