/makewanted
#1

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;
}
Reply
#2

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.
Reply
#3

The problem is I don't have any single idea to write this code on my own ^^
Reply
#4

Bump
Reply
#5

I have that cmd on my trucking server,maybe it will help...


PHP код:
// Increases the player's wanted level by 1
COMMAND:wanted(playeridparams[])
{
    new 
OtherPlayerStars;

    
// 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"OtherPlayerStars)) SendClientMessage(playerid0xFF0000AA"Command: \"/wanted <player> <Stars>\"");
            else
                if (
IsPlayerConnected(OtherPlayer)) // If the player is a valid playerid (he's connected)
                    
PostaviWantedLevel(OtherPlayerStars);
                else
                    
SendClientMessage(playerid0xFF0000FF"That player is not online");
        }
        else
            return 
0;
    }
    else
        return 
0;

    
// Let the server know that this was a valid command
    
return 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)