Cant change my skin
#1

Hey guys. I now have a script that saves skins. But when I do F4 /kill now I can't change it anymore :*(
can someone please help me to fix this and you can change your skin with F4 /kill?
kind regards: Bart
Thanks for reading though
Код:
#include <a_samp>
#include <dini>
new stringskin[256];
#include <dutils>//you need this include
#include <dudb>//this too
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_TRIES 3 // Tries number before kick the player
#define COLOR_RED 0xFF0000FF //RED
new PLAYERLIST_authed[MAX_PLAYERS];
new pkills[MAX_PLAYERS];
new pdeaths[MAX_PLAYERS];
new tries[MAX_PLAYERS];
public OnFilterScriptInit()
{
  print("\n================================================================");
  print("         Register system:");
  	print("           Iniciated");
  	print("         Created By: Joaum");
  	print("================================================================");
  	print("\n");
}
stock SystemMsg(playerid,msg[]) {
  if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
    SendClientMessage(playerid,COLOR_SYSTEM,msg);
  }
  return 1;
}

stock PlayerName(playerid) {
 new name[255];
 GetPlayerName(playerid, name, 255);
 return name;
}

 dcmd_register(playerid,params[]) {

  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"You are Already Logged In.");

  if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exist '/login password'.");

  if (strlen(params)==0) return SystemMsg(playerid,"Correct Usage: '/register password'");

  if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account has been created '/login password' now.");
  PLAYERLIST_authed[playerid]=false;
  return true;
}
dcmd_login(playerid,params[])
{
  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"You already are Logged in.");
  if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exists '/register password'.");
  if (strlen(params)==0) return SystemMsg(playerid,"Use '/login password'");

  if (udb_CheckLogin(PlayerName(playerid),params))
	{
    // Status
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")+GetPlayerMoney(playerid));
    SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("Score")+GetPlayerScore(playerid));
    SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("Skin")+GetPlayerSkin(playerid));
    pkills[playerid] = (playerid,dUserINT(PlayerName(playerid)).("Kills")+pkills[playerid]);
    pdeaths[playerid] = (playerid,dUserINT(PlayerName(playerid)).("Deaths")+pdeaths[playerid]);
    PLAYERLIST_authed[playerid]=true;
    SpawnPlayer(playerid);

    return SystemMsg(playerid,"Succefully Logged in!");
  }
  // Bad Password
  	tries[playerid]++;
  	if(tries[playerid] == MAX_TRIES)
	{
	  SystemMsg(playerid,"You got kicked for too much password mistakes!!");
	  print("The Player was kicked for didnt put the password correctly");//lets print this to warn the server
		Kick(playerid);
  }
  	else if (tries[playerid] == MAX_TRIES-1)
 	{
  		SendClientMessage(playerid, COLOR_RED, "Next Time You will be kicked!!!");//ouch..
	}
	return 0;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerSkin(playerid, dUserINT(PlayerName(playerid)).("Skin"));
	return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
 dcmd(login,5,cmdtext);
 dcmd(register,8,cmdtext);

 if(strcmp(cmdtext, "/mystats", true) == 0)
  {
  new stringkills[256];
  new stringmortes[256];
  new stringratio[256];
  new stringscore[256];
  new stringdinheiro[256];
  new Float:ratio=floatdiv(pkills[playerid],pdeaths[playerid]);
  format(stringkills,sizeof(stringkills), "Kills: %d",pkills[playerid]);
  format(stringmortes,sizeof(stringmortes), "Deaths: %d",pdeaths[playerid]);
  format(stringratio,sizeof(stringratio), "Ratio: %.2f",ratio);
  format(stringdinheiro,sizeof(stringdinheiro), "Money: %d",GetPlayerMoney(playerid));
  format(stringscore,sizeof(stringscore), "Score: %d",GetPlayerScore(playerid));
  format(stringskin,sizeof(stringskin), "Skin: %d",GetPlayerSkin(playerid));
  SendClientMessage(playerid, 0xFFFF00AA, "         ");
  SendClientMessage(playerid, 0xFFFF00AA, "Your stats:");
  SendClientMessage(playerid, 0xFFFF00AA, stringkills);
  SendClientMessage(playerid, 0xFFFF00AA, stringmortes);
  SendClientMessage(playerid, 0xFFFF00AA, stringratio);
  SendClientMessage(playerid, 0xFFFF00AA, stringscore);
  SendClientMessage(playerid, 0xFFFF00AA, stringdinheiro);
  SendClientMessage(playerid, 0xFFFF00AA, stringskin);
  SendClientMessage(playerid, 0xFFFF00AA, "        ");
  return 1;
}

 return false;
}

public OnPlayerRequestSpawn(playerid)
{
  if (!PLAYERLIST_authed[playerid]){
  if (udb_Exists(PlayerName(playerid))) {
  SendClientMessage(playerid, COLOR_SYSTEM, "------------------------------------------");
  SendClientMessage(playerid, COLOR_SYSTEM, "|                     |");
  SendClientMessage(playerid, COLOR_SYSTEM, "This Account /lois Registered gin password ");
  SendClientMessage(playerid, COLOR_SYSTEM, "|                |");
  SendClientMessage(playerid, COLOR_SYSTEM, "------------------------------------------");
  new Float:X;
  	new Float:Y;
  	new Float:Z;
  	GetPlayerPos(playerid, X, Y, Z);
  	PlayerPlaySound(playerid,1147, X, Y, Z);//music
  	return 0;
  }
  	else SendClientMessage(playerid, COLOR_SYSTEM, "You Can Spawn Now!!!");
  }
  return 1;
}

public OnPlayerText(playerid, text[])
{  if (!PLAYERLIST_authed[playerid]){
  if (udb_Exists(PlayerName(playerid))){
  SystemMsg(playerid,"You are not logged in to use The Chat!");
  new Float:X;
  new Float:Y;
  new Float:Z;
  GetPlayerPos(playerid, X, Y, Z);
  PlayerPlaySound(playerid,1147, X, Y, Z);//music
  }
  return 0;
 }
  return 1;
}

public OnPlayerDeath(playerid, killerid, reason)

{

  if (killerid != INVALID_PLAYER_ID) {

     pkills[killerid] ++;
     pdeaths[playerid] ++;
   }


  return 1;

}

 public OnPlayerConnect(playerid) {
 tries[playerid] = 0;
 PLAYERLIST_authed[playerid]=false;
 if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, COLOR_SYSTEM, "Welcome Back! This Account is registred (/Login password)");
 return false;


}

public OnPlayerDisconnect(playerid) {
 if (PLAYERLIST_authed[playerid]) {
   // save
  dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
  dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));
  dUserSetINT(PlayerName(playerid)).("Skin",GetPlayerSkin(playerid));
  dUserSetINT(PlayerName(playerid)).("Kills",pkills[playerid]);
  dUserSetINT(PlayerName(playerid)).("Deaths",pdeaths[playerid]);
 }
 PLAYERLIST_authed[playerid]=false;
 return false;
}

public OnPlayerRequestClass(playerid, classid)
{
  format(stringskin,sizeof(stringskin), "Skin: %d",GetPlayerSkin(playerid));
	return 1;
	
 }
Reply
#2

Does anyone knows how to fix this?
Reply
#3

http://forum.sa-mp.com/index.php?topic=150589.0

btw you dont have to make shitloads of topic about it, try being creative..
Reply
#4

Quote:
Originally Posted by Notime
http://forum.sa-mp.com/index.php?topic=150589.0

btw you dont have to make shitloads of topic about it, try being creative..
People won't reply on that anymore and I really have to do it with F4 /kill
Reply
#5

why?
cant ye do it with /changeskin [skin id]?
Reply
#6

Quote:
Originally Posted by Notime
why?
cant ye do it with /changeskin [skin id]?
Well I can, But then I want that people need /permission [playerid] to take these skins:

0 105 106 107 102 103 104 114 115 116 108 109 110 277 278 279 280 281 282 287

If that would be possible the /changeskin would be awesome
Can someone help me with it>
Or maybe you Notime? It seems that you are good at stuff like that


Regards
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)