/makewanted - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /makewanted (
/showthread.php?tid=581915)
/makewanted -
Lajko1 - 16.07.2015
So far I've made this cmd with help of people from this community the problem is, how can I make that it will save every crime specifically so it won't rewrite current crime..
Current command, and I'm using yini saving
pawn Код:
CMD:makewanted(playerid,params[])
{
new id, reason[80], string[50];
if(sscanf(params, "us[80]",id ,reason)) return SendClientMessage(playerid,-1,"USAGE: REPORT <PlayerID/Part of Name> <Reason>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player Not connected");
format(PlayerInfo[id][pCrimes], 80, reason);
new INI:File = INI_Open(UserPath(id));
INI_WriteString(File,"Crimes",PlayerInfo[id][pCrimes]);
INI_Close(File);
format(string, sizeof(string), "Crime %s saved", reason);
SendClientMessage(playerid, -1, string);
return 1;
}
Re: /makewanted -
Smithy - 16.07.2015
Usually when you want to tot text up, you use text = text + newtext.
So you'd set a variable as crimes, and the formula would be crimes = crimes + newcrime each time the crime command is added.
At least that's similar to how it works for languages like VB/Java.
Re: /makewanted -
Lajko1 - 16.07.2015
The problem is I don't have any single idea to write this code on my own ^^
Re: /makewanted -
Lajko1 - 17.07.2015
Bump
Re: /makewanted -
NexySamp - 18.07.2015
I have that cmd on my trucking server,maybe it will help...
PHP код:
// Increases the player's wanted level by 1
COMMAND:wanted(playerid, params[])
{
new OtherPlayer, Stars;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/trazen", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 5)
{
if (sscanf(params, "ui", OtherPlayer, Stars)) SendClientMessage(playerid, 0xFF0000AA, "Command: \"/wanted <player> <Stars>\"");
else
if (IsPlayerConnected(OtherPlayer)) // If the player is a valid playerid (he's connected)
PostaviWantedLevel(OtherPlayer, Stars);
else
SendClientMessage(playerid, 0xFF0000FF, "That player is not online");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}