23.02.2012, 20:08
I wanted to attach an armour on the player on selling it to anyone but when he sells it to only the seller gets the armour object attached and the other player gets the armour points, how can i make it so when the player sells it to the name/id the buyer gets the object attached.
Код HTML:
if(strcmp(cmd, "/sellarmour", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREEN, "USAGE: /sellarmour [playerid/PartOfName]"); return 1; } new playa; new health; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); health = strval(tmp); if(PlayerInfo[playerid][pJob] != 0) if(PlayerInfo[playerid][pJob] != 1) if(PlayerInfo[playerid][pJob] != 2) if(PlayerInfo[playerid][pJob] != 3) if(PlayerInfo[playerid][pJob] != 4) if(PlayerInfo[playerid][pJob] != 5) if(PlayerInfo[playerid][pJob] != 6) if(PlayerInfo[playerid][pJob] != 7) if(PlayerInfo[playerid][pJob] != 9) if(PlayerInfo[playerid][pJob] != 10) if(PlayerInfo[playerid][pJob] != 11) if(PlayerInfo[playerid][pJob] != 12) if(PlayerInfo[playerid][pJob] != 13) if(PlayerInfo[playerid][pJob] != 14) if(PlayerInfo[playerid][pJob] != 15) if(PlayerInfo[playerid][pJob] != 17) if(PlayerInfo[playerid][pJob] != 18) if(PlayerInfo[playerid][pJob] != 19) if(PlayerInfo[playerid][pJob] != 20) if(PlayerInfo[playerid][pJob] != 21) if(PlayerInfo[playerid][pJob] != 22) if(PlayerInfo[playerid][pJob] != 23) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { SafeSetPlayerArmour(playa, 100); SetPlayerAttachedObject(playerid,3,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);\\ The armour object. GetPlayerName(playa, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "Mercenary %s Has Sold you an armour.",sendername, health); SendClientMessage(playa, TEAM_GROVE_COLOR, string); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Sold %s an Armour",d,m,y,h,mi,s,sendername,giveplayer,health); GiveLog(string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "** you are a Mercenary!"); } } return 1; }