SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/02/2013, 11:35 PM   #1
DerickClark
High-roller
 
DerickClark's Avatar
 
Join Date: Jul 2012
Posts: 1,570
Reputation: 9
Default Need help on Helpers

Here my Code i Wanna to save the stat's on Helper's

Code:
COMMAND:sethelper(playerid, params[])
{
    new pID, str[128];
    if(!IsPlayerAdmin(playerid))
    return SendClientMessage(playerid, -1, "Only admins can use this command.");
    if(sscanf(params,"u", pID))
    return SendClientMessage(playerid,-1,"USAGE: /sethelper [PlayerID]");
    if(!IsPlayerConnected(pID))
    return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
    if(playerHelper[pID])
    return SendClientMessage(playerid, -1, "Selected player is a helper already.");
    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
    GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    playerHelper[pID] = true;
    format(str, sizeof str, "Admin %s made you a helper.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You made %s a helper.", name);
    SendClientMessage(playerid, -1, str);
    // Let the server know that this was a valid command
    return 1;
}
Code:
// This function will save all player-data (used when the player disconnects from the server)
PlayerFile_Save(playerid)
{
        format(LineForFile, 100, "Helper %i\r\n", APlayerData[playerid][PlayerLevel]); // Construct the line: "Helper <playerlevel>"
	fwrite(PFile, LineForFile); // And save it to the file
	return 1;
}
Code:
  	        if (strcmp(ParameterName, "Helper", false) == 0) // If the parametername is correct ("Level")
                APlayerData[playerid][PlayerLevel] = strval(ParameterValue); // Store the playerlevel
__________________
LS-CNR
DerickClark is offline   Reply With Quote
Old 07/02/2013, 11:53 PM   #2
zDevon
Huge Clucker
 
Join Date: Jan 2012
Location: Charlotte, NC (USA)
Posts: 316
Reputation: 31
Default Re: Need help on Helpers

You store the player's helper level in playerHelper but you are saving APlayerData[playerid][PlayerLevel] (which I'm assuming is the player's score, since I see no where you set that equal to playerHelpler).
zDevon is offline   Reply With Quote
Old 07/02/2013, 11:55 PM   #3
DerickClark
High-roller
 
DerickClark's Avatar
 
Join Date: Jul 2012
Posts: 1,570
Reputation: 9
Default Re: Need help on Helpers

Can you give me the code? of the helper?
__________________
LS-CNR
DerickClark is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on Helpers DerickClark Scripting Help 4 23/01/2013 01:01 AM
Helpers Alex0 Scripting Help 3 23/12/2012 07:25 PM
Need Helpers thefatshizms Server Support 4 07/10/2012 02:43 PM
Looking for a few helpers Kontrol Scripting Help 0 09/04/2012 09:43 PM
Need help + rep to helpers Anthony_X Server Support 30 05/01/2012 11:31 AM


All times are GMT. The time now is 07:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.