SA-MP Forums Archive
I need ONE HELP.. Please - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need ONE HELP.. Please (/showthread.php?tid=268781)



(HELP) Read file from scriptfiles folder into game - spaty2 - 13.07.2011

Quote:

public OnPlayerCommandText(playerid, cmdtext[]) {
new
cmd[256], tmp[256], idx,
p_name[MAX_PLAYER_NAME], o_name[MAX_PLAYER_NAME]
;
cmd = strtok(cmdtext, idx);
if(strcmp("/dlicense", cmd, true) == 0) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /dlicense [ID]");
new ID = strval(tmp);
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "SERVER: playerid isn't connected!");
GetPlayerName(ID, o_name, sizeof(o_name));
GetPlayerName(playerid, p_name, sizeof(p_name));
//Do your code here, getting the playerid his INI file and checking if he owns a LICENSE!
printf("LICENSE: [%d]%s showed [%d]%s his license.", playerid, p_name, ID, o_name);
return 1;
}
return 0;
}

stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

What code i must write there? Where is typed: //Do your code here, getting the playerid his INI file and checking if he owns a LICENSE!
Please?


Re: I need ONE HELP.. Please - spaty2 - 13.07.2011

Someone?


Re: I need ONE HELP.. Please - crowb14 - 13.07.2011

ur not allowed 2 post ur title as that
this is from the rules
Quote:

a) Use a proper subject
Something like '------------>HELP PLZ FAST NOW HELP!!!!!!!!!!!<----------' is not very descriptive and very annoying.
Make a proper subject with a short description, such as 'Gates won't open' or 'Game crashes instantly'




(HELP) Read from file to Game - spaty2 - 13.07.2011

Ok, sorry, i'll change, please Delete this thread