Little help.
#1

I want to change something in one GM, it's the command suspect, when you /suspec someone he should receive a wanted level. This is the command, what should I do to add wanted level to the person who I am suspecting?
Код:
if(strcmp(cmd, "/suspect", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_LIGHTBLUE2, "[USAGE:] /suspect [playerid] [crime]");
                PlayCrimeReportForPlayer(playerid,0,3);
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[128];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_LIGHTBLUE2, "[USAGE:] /suspect [playerid] [crime]");
							return 1;
						}
      					if(CopOnDuty[playerid])
						{
							if(giveplayerid != playerid)
							{
								if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
								else { WantedPoints[giveplayerid]+= 2; }
								format(string, sizeof(string), "You have been suspected by %s, Reason: %s.", GetPlayerNameEx(playerid),result);
								SendClientMessage(giveplayerid, COLOR_RED, string);
								format(string, sizeof(string), "You have suspected %s, Reason: %s.", GetPlayerNameEx(giveplayerid),result);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "[SASP] %s has suspected %s, Reason: %s.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid),result);
								SendFactionTypeMessage(1,COLOR_LSPD,string);
								SetWantedLevel(id, 1);
								new location[MAX_ZONE_NAME];
								GetPlayer2DZone(giveplayerid, location, MAX_ZONE_NAME);
								format(string, sizeof(string), "[SASP] All units be on the lookout for %s - Person Last Seen: %s.", GetPlayerNameEx(giveplayerid),location);
								SendFactionTypeMessage(1,COLOR_LSPD,string);
							}
							else
							{
	                            SendClientMessage(playerid, COLOR_LIGHTBLUE2, "You can't suspect yourself!");
							}
						}
      					else
						{
      						SendClientMessage(playerid, COLOR_LIGHTBLUE2, "Your not on cop duty!");
						}
						return 1;
					}
				}
			}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)