04.04.2014, 14:33
I made point system and i made In game point edit and all of them work good except the name edit
when i type it in game it give me: /pedit name [pointid] [name]
and nothing happen:
THE COMMAND:
when i type it in game it give me: /pedit name [pointid] [name]
and nothing happen:
pawn Код:
if(!strcmp(params, "name", true, 4))
{
if(sscanf(params, "s[32]ic", params, point, name)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit name [pointid] [name]");
if(point < 1 || point > 6) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
format(string, sizeof(string), "AdmWarn: %s has changed %s point name to %s", RPN(playerid), PointInfo[point][pName], name);
SendAdminMessage(COLOR_DARKRED, 1, string);
PointInfo[point][pName] = name;
}
pawn Код:
CMD:pedit(playerid, params[])
{
new string[128],
time,
point,
Float:x,
Float:y,
Float:z,
name,
profit;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(sscanf(params, "s[32]", params))
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit [option]");
SendClientMessage(playerid, COLOR_GREY, "OPTIONS: location | time | name | profit");
return 1;
}
if(!strcmp(params, "location", true, 8))
{
if(sscanf(params, "s[32]i", params, point)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit location [pointid]");
if(point < 1 || point > 6) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
GetPlayerPos(playerid,x,y,z);
DestroyDynamic3DTextLabel(PointInfo[point][pText]);
DestroyPickup(PointInfo[point][pPickup]);
PointInfo[point][pX] = x;
PointInfo[point][pY] = y;
PointInfo[point][pZ] = z;
PointInfo[point][pText] = CreateDynamic3DTextLabel("Point\n/capture", -1, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ]+0.3, 15);
PointInfo[point][pPickup] = CreatePickup(1274, 1, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ], 0);
format(string, sizeof(string)," You have set the point %s id coordinates in your position",PointInfo[point][pName]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "AdmWarn: %s has changed the %s point position.", RPN(playerid), PointInfo[point][pName]);
SendAdminMessage(COLOR_DARKRED, 1, string);
}
if(!strcmp(params, "time", true, 4))
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "s[32]ii", params, point, time)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit time [pointid] [timeid]");
if(point < 1 || point > 6) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
if(time < 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid time.");
point = point-1;
PointInfo[point][pTime] = time;
format(string, sizeof(string), "AdmWarn: %s has set the %s point to be capturable in %d hours.", RPN(playerid), PointInfo[point][pName], PointInfo[point][pTime]);
SendAdminMessage(COLOR_DARKRED, 1, string);
}
if(!strcmp(params, "name", true, 4))
{
if(sscanf(params, "s[32]ic", params, point, name)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit name [pointid] [name]");
if(point < 1 || point > 6) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
format(string, sizeof(string), "AdmWarn: %s has changed %s point name to %s", RPN(playerid), PointInfo[point][pName], name);
SendAdminMessage(COLOR_DARKRED, 1, string);
PointInfo[point][pName] = name;
}
if(!strcmp(params, "profit", true, 6))
{
if(sscanf(params, "s[32]ii", params, point, profit)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit profit [pointid] [amount]");
if(point < 1 || point > 6) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
PointInfo[point][pProfit] = profit;
format(string, sizeof(string), "AdmWarn: %s has changed %s point profit to %d$", RPN(playerid), PointInfo[point][pName], PointInfo[point][pProfit]);
SendAdminMessage(COLOR_DARKRED, 1, string);
}
return 1;
}