Jump to content

Question

Posted

salut , am comanda de /setinterior [/setint]

cum pot face din aceasta comanda , daca cineva scrie /setint [id] 20 [mai mult de 20] sa primeasca SendClientMesagge(playerid, 0xFFFFFFFF, "Nu poti sa setezi un nterior mai mare decat 20!");

comanda este:

if(strcmp(cmd, "/setint", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setint [playerid/PartOfName] [interiorid]");
				return 1;
			}
			new playa;
			new intid;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			intid = strval(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
 						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						SetPlayerInterior(playa,intid);
						PlayerInfo[playerid][pInt] = intid;
						format(string, sizeof(string), "   You have set the players interiorid %d.", intid);
						SendClientMessage(playerid, COLOR_GRAD1, string);
						GetPlayerName(playerid, sendername, sizeof(sendername));
			         	format(string, 256, "AdmWarning: %s has used command /setint !", sendername);
			            ABroadCast(COLOR_YELLOW,string,1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nu ai voie sa folosesti comanda aceasta  !");
			}
		}
		return 1;
	}

metallica-logo.jpg

2 answers to this question

Recommended Posts

Posted
if(strcmp(cmd, "/setint", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setint [playerid/PartOfName] [interiorid]");
				return 1;
			}
			new playa;
			new intid;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			intid = strval(tmp);
                        if(intid > 20) { SendClientMessage(playerid, 0xFFFFFFFF, "Nu poti sa setezi un nterior mai mare decat 20!"); return 1; }
			if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
 						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						SetPlayerInterior(playa,intid);
						PlayerInfo[playerid][pInt] = intid;
						format(string, sizeof(string), "   You have set the players interiorid %d.", intid);
						SendClientMessage(playerid, COLOR_GRAD1, string);
						GetPlayerName(playerid, sendername, sizeof(sendername));
			         	format(string, 256, "AdmWarning: %s has used command /setint !", sendername);
			            ABroadCast(COLOR_YELLOW,string,1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nu ai voie sa folosesti comanda aceasta  !");
			}
		}
		return 1;
	}

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.