28.07.2010, 00:49
(
Последний раз редактировалось MWF2; 28.07.2010 в 01:15.
)
I have added a weapons dialog, and it is very unorganized. I don't understand why though. Can someone fix that please, I'm not sure why it's doing that....
Here is a screenshot:
![](/imageshack/img827/349/save.png)
My second problem is, My /drag command is working fine except, it's only suppose to work if a player is cuffed. Even if the player is cuffed, it says "Player is not handcuffed"
pawn Код:
ShowPlayerDialog(giveplayerid,WEAPONDEALER_DIALOG,2,"Weapon Dealers List","Silenced 9mm\t\t\t $2500\nTec9\t\t\t $1000\nS/O Shotgun\t\t\t $3500\nSniper Rifle\t\t\t $15000\nAK47\t\t\t $8000\nArmour\t\t\t $500\n3 Blocks Of C4\t\t\t $3500\nParachute\t\t\t $10000\nM4\t\t\t $1000\nRifle\t\t\t $7000\nDesert Eagle\t\t\t $5000","Buy","Cancel");
Here is a screenshot:
![](/imageshack/img827/349/save.png)
My second problem is, My /drag command is working fine except, it's only suppose to work if a player is cuffed. Even if the player is cuffed, it says "Player is not handcuffed"
pawn Код:
if(strcmp(cmd, "/drag", true) == 0)
{
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(Jailed[playerid] ==1) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
return 1;
}
if(gTeam[playerid] != TEAM_SWAT) {
SendClientMessage(playerid,COLOR_ERROR,"You are not part of the SWAT team. Only SWAT can use this command");
return 1;
}
if(cuffed[giveplayerid] == 0) {
SendClientMessage(playerid,COLOR_ERROR,"That player is not handcuffed! Please cuff the suspect before dragging.");
return 1;
}
if(InDerby[playerid] == 1) {
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command while you are in the stadium");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /drag (id)");
return 1;
}
giveplayerid = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /drag (id) ID Must be a number");
return 1;
}
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) {
format(szstring, sizeof(szstring), "ID (%d) is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, szstring);
return 1;
}
GetPlayerName(playerid,oname, 24);
GetPlayerName(giveplayerid, pname, 24);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /drag (id) ID Must be a number");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 4) {
format(szstring, sizeof(szstring), "%s(%d) Is not close enough you cannot drag that player",pname, giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, szstring);
return 1;
}
if(Jailed[giveplayerid] == 1) {
format(szstring, sizeof(szstring), "%s(%d) Is in jail. You cannot drag a prisoner",pname, giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, szstring);
return 1;
}
if(IsPlayerInAnyVehicle(playerid)) {
SendClientMessage(playerid, COLOR_ERROR, "You are in a vehicle. You must be on foot to drag");
return 1;
}
if(gTeam[playerid] == TEAM_COP && gTeam[playerid] == TEAM_ARMY && gTeam[playerid] == TEAM_SWAT && gTeam[playerid] == TEAM_MARINE && gTeam[playerid] == TEAM_AIRSUPPORT) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot drag a Law Enforcement agent");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid)) {
SendClientMessage(playerid, COLOR_ERROR, "That player is already in a vehicle");
return 1;
}
if(gLastCar[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You must have a vehicle before using this command!");
return 1;
}
if(GetPlayerWantedLevel(giveplayerid) <= 3) {
format(szstring, sizeof(szstring), "%s(%d) Does not have a warrant. You cannot drag that player",pname,giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, szstring);
return 1;
}
SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_DRAGGED_|");
format(szstring, sizeof(szstring), "%s(%d): has dragged you,use /breakcuffs to attempt an escape!",oname, playerid);
SendClientMessage(giveplayerid, COLOR_DODGERBLUE, szstring);
TogglePlayerControllable(giveplayerid, 0);
oscore = GetPlayerScore(playerid);
SetPlayerScore(playerid, oscore +1);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Criminal Dragged|");
format(szstring, sizeof(szstring), "You have grabbed %s(%d) and thrown him into your car!", pname, giveplayerid);
SendClientMessage(playerid, COLOR_DODGERBLUE, szstring);
format(szstring, sizeof(szstring), "%s(%d) has grabbed %s(%d) and thrown him into his car!",oname,playerid,pname,giveplayerid);
SendClientMessageToAll(0x00C7FFAA, szstring);
PutPlayerInVehicle(giveplayerid,gLastCar[playerid],1);
Dragged[giveplayerid] =1;
format(szstring, sizeof(szstring), "~r~DRAGGED BY SWAT MEMBER~n~~w~%s(%d)",oname,playerid);
GameTextForPlayer(giveplayerid,szstring,5000,3);
swatrank[playerid] +=1;
return 1;
}