Jump to content
  • 0

[GF/RP] Problema /su


hopingsteam

Question

    if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "COMANDA: (/su)spect [ ID / nume ] [ motiv ]");
				return 1;
			}
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 16)
			{
			   	if(OnDuty[playerid] != 1)
				{
					SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not on Duty!");
					return 1;
				}
				if(WantedPoints[giveplayerid] == 6)
				{
					SendClientMessage(playerid, COLOR_LIGHTGREEN, "Jucatorul are deja wanted 6!");
					return 1;
				}
				else if (gTeam[playerid] == 2 || IsACop(playerid))
				{
			  	  	giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
					    if(giveplayerid != INVALID_PLAYER_ID)
					    {
							if (gTeam[giveplayerid] != 2)
							{
							    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							    if(PlayerInfo[giveplayerid][pJailTime] == 0)
							    {
									GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
									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, "COMANDA: (/su)spect [ ID / Nume ] [motiv]");
										return 1;
									}
									if(WantedPoints[giveplayerid] == 1) 
									{ 
										WantedPoints[giveplayerid] = 2; 
									}
									else 
									{ 
										WantedPoints[giveplayerid]+= 2 ; 
									}
									SetPlayerCriminal(giveplayerid,playerid, result);
									format(string, sizeof(string), "Suspect ID:%d - Wanted Points %d", giveplayerid, WantedLevel[giveplayerid]);
									SendClientMessage(playerid,COLOR_YELLOW, string);
									return 1;
								}
								else
								{
									format(string, sizeof(string), " %s este la inchisoare, nu ii poti da wanted !", giveplayer);
									SendClientMessage(playerid, COLOR_GRAD1, string);
									return 1;
								}
							}
							else
							{
								SendClientMessage(playerid, COLOR_GRAD2, " Nu poti da wanted la politisti !");
							}
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD2, "This player isn't online!");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Nu esti politist ! !");
			}
		}
		return 1;
	}

1: Am incercat sa pun maxim wanted 6, dar nu merge, ma puteti ajuta ?

2: Prima data cand dau /su: Wanted 0, a doua oara cand dau /su: Wanted 2, apoi 3,4,5 ... Cum pot face sa dau 1 ?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

    if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "COMANDA: (/su)spect [ ID / nume ] [ motiv ]");
				return 1;
			}
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 16)
			{
			   	if(OnDuty[playerid] != 1)
				{
					SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not on Duty!");
					return 1;
				}
				else if (gTeam[playerid] == 2 || IsACop(playerid))
				{
			  	  	giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
					    if(giveplayerid != INVALID_PLAYER_ID)
					    {
							if (gTeam[giveplayerid] != 2)
							{
							    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							    if(PlayerInfo[giveplayerid][pJailTime] == 0)
							    {
									if(WantedPoints[giveplayerid] == 6)
									{
										SendClientMessage(playerid, COLOR_LIGHTGREEN, "Jucatorul are deja wanted 6!");
										return 1;
									}
									GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
									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, "COMANDA: (/su)spect [ ID / Nume ] [motiv]");
										return 1;
									}
									WantedPoints[giveplayerid]++;
									SetPlayerCriminal(giveplayerid,playerid, result);
									format(string, sizeof(string), "Suspect ID:%d - Wanted Points %d", giveplayerid, WantedLevel[giveplayerid]);
									SendClientMessage(playerid,COLOR_YELLOW, string);
									return 1;
								}
								else
								{
									format(string, sizeof(string), " %s este la inchisoare, nu ii poti da wanted !", giveplayer);
									SendClientMessage(playerid, COLOR_GRAD1, string);
									return 1;
								}
							}
							else
							{
								SendClientMessage(playerid, COLOR_GRAD2, " Nu poti da wanted la politisti !");
							}
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD2, "This player isn't online!");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Nu esti politist ! !");
			}
		}
		return 1;
	}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

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.