16.02.2013, 17:28
Is that okay to use PVarInt on it, or should I use global variables?
Код:
CMD:convo(playerid, params[]) { new pid, str[128]; if(sscanf(params,"d",pid)) return SyntaxMSG(playerid, "/convo [playerid]"); if(GetIntVar(playerid, "InConvo") == 1) return ConvoMSG(playerid, "You are talking already, '/endconvo' first."); if(!PlayerIsOn(pid)) return NotConnectedMSG(playerid); SetIntVar(playerid, "InConvo", 1); SetIntVar(playerid, "ConvoWith", pid); format(str, sizeof(str), "[ID:%d]%s has started a conversation with you, you may convo with him by /convo. (NOTE: This is an OOC'ly chat)", playerid, GetName(playerid)); ConvoMSG(pid, str); ConvoMSG(playerid, "You may start talking with the person, by typing normally. (NOTE: This is an OOC'ly chat)"); return 1; } CMD:endconvo(playerid, params[]) { new str[128]; if(GetIntVar(playerid, "InConvo") == 0) return ConvoMSG(playerid, "You are not talking in a convo."); format(str, sizeof(str), "[ID:%d]%s has ended the conversation with you.", playerid, GetName(playerid)); ConvoMSG(GetIntVar(playerid, "ConvoWith"), str); format(str, sizeof(str), "You have stopped the conversation with [ID:%d]%s", GetIntVar(playerid, "ConvoWith"), GetName(GetIntVar(playerid, "ConvoWith"))); ConvoMSG(playerid, str); RemoveVar(playerid, "InConvo"); RemoveVar(playerid, "ConvoWith"); return 1; }