17.12.2009, 16:05
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256], idx, file[128], tmp[256], tmp2[256]; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/register", true) == 0) { new name[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); GetPlayerName(playerid, name, sizeof(name)); if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]"); format(file,sizeof(file),"%s.ini",name); if(!fexist(file)) { dini_Create(file); dini_IntSet(file, "Password", udb_hash(tmp)); dini_IntSet(file,"Materials", 10); dini_IntSet(file,"Cash", 10); dini_IntSet(file,"Dead", 0); SendClientMessage(playerid, COLOR_SYSTEM, "Account created!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GetPlayerName(playerid, name, sizeof(name)); printf("%s has registered a account!", name); } else { SendClientMessage(playerid, COLOR_SYSTEM, "[System]: Account already found in database!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } return 1; }
If anyone can help me thanks
Code:
public OnPlayerDeath(playerid, killerid, reason) { // What goes here? return 1; }
Code:
public OnPlayerConnect(playerid) { // And here? return 1; }